1. 28 Apr, 2015 19 commits
    • Rob Pike's avatar
      cmd/doc: print documentation for all matches in a package, not just the first · d3bd6b6a
      Rob Pike authored
      Change-Id: Id0d4ac7169f741dfeec7b1e67bdc21e49ae37b9e
      Reviewed-on: https://go-review.googlesource.com/9430Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      d3bd6b6a
    • Rob Pike's avatar
      cmd/asm: add comments back for aliases on jumps for x86 · a88994c1
      Rob Pike authored
      These were lost in the transition from 8a/6a to asm.
      Also, in the process, discover more aliases. I'm betting the missing
      ones were a casualty of the recent merge of 386 and amd64.
      
      Update #10385.
      
      Change-Id: I1681034b25af3ffc103f75e5fc57baca5feb3fcd
      Reviewed-on: https://go-review.googlesource.com/9431Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      a88994c1
    • Adam Langley's avatar
      doc: mention several recent crypto changes in go1.5.txt · d2d840aa
      Adam Langley authored
      Change-Id: Icf212fc7ea108ff22bb7fa9da137410d729d2569
      Reviewed-on: https://go-review.googlesource.com/9413Reviewed-by: default avatarAdam Langley <agl@golang.org>
      d2d840aa
    • Richard Barnes's avatar
      encoding/asn1: Improved control of flags and times · 0bb96bea
      Richard Barnes authored
      This change corrects the serialization of asn1.Flag values, so that
      when set, they serialize to an empty value, and when unset, they are
      omitted. It also adds a format parameter that allows calling code
      to control whether time.Time values are serialized as UTCTime or
      GeneralizedTime.
      
      Change-Id: I6d97abf009ea317338dab30c80f35a2de7e07104
      Reviewed-on: https://go-review.googlesource.com/5970Reviewed-by: default avatarAdam Langley <agl@golang.org>
      Run-TryBot: Adam Langley <agl@golang.org>
      0bb96bea
    • Adam Langley's avatar
      crypto/x509: allow parsing of certificates with unknown critical extensions. · d942737f
      Adam Langley authored
      Previously, unknown critical extensions were a parse error. However, for
      some cases one wishes to parse and use a certificate that may contain
      these extensions. For example, when using a certificate in a TLS server:
      it's the client's concern whether it understands the critical extensions
      but the server still wishes to parse SNI values out of the certificate
      etc.
      
      This change moves the rejection of unknown critical extensions from
      ParseCertificate to Certificate.Verify. The former will now record the
      OIDs of unknown critical extensions in the Certificate and the latter
      will fail to verify certificates with them. If a user of this package
      wishes to handle any unknown critical extensions themselves, they can
      extract the extensions from Certificate.Extensions, process them and
      remove known OIDs from Certificate.UnknownCriticalExtensions.
      
      See discussion at
      https://groups.google.com/forum/#!msg/golang-nuts/IrzoZlwalTQ/qdK1k-ogeHIJ
      and in the linked bug.
      
      Fixes #10459
      
      Change-Id: I762521a44c01160fa0901f990ba2f5d4977d7977
      Reviewed-on: https://go-review.googlesource.com/9390Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      d942737f
    • Austin Clements's avatar
      runtime: eliminate one heapBitsForObject from scanobject · 63caec5d
      Austin Clements authored
      scanobject with ptrmask!=nil is only ever called with the base
      pointer of a heap object. Currently, scanobject calls
      heapBitsForObject, which goes to a great deal of trouble to check
      that the pointer points into the heap and to find the base of the
      object it points to, both of which are completely unnecessary in
      this case.
      
      Replace this call to heapBitsForObject with much simpler logic to
      fetch the span and compute the heap bits.
      
      Benchmark results with five runs:
      
      name                                    old mean                new mean        delta
      BenchmarkBinaryTree17              9.21s × (0.95,1.02)     8.55s × (0.91,1.03)  -7.16% (p=0.022)
      BenchmarkFannkuch11                2.65s × (1.00,1.00)     2.62s × (1.00,1.00)  -1.10% (p=0.000)
      BenchmarkFmtFprintfEmpty          73.2ns × (0.99,1.01)    71.7ns × (1.00,1.01)  -1.99% (p=0.004)
      BenchmarkFmtFprintfString          302ns × (0.99,1.00)     292ns × (0.98,1.02)  -3.31% (p=0.020)
      BenchmarkFmtFprintfInt             281ns × (0.98,1.01)     279ns × (0.96,1.02)  ~ (p=0.596)
      BenchmarkFmtFprintfIntInt          482ns × (0.98,1.01)     488ns × (0.95,1.02)  ~ (p=0.419)
      BenchmarkFmtFprintfPrefixedInt     382ns × (0.99,1.01)     365ns × (0.96,1.02)  -4.35% (p=0.015)
      BenchmarkFmtFprintfFloat           475ns × (0.99,1.01)     472ns × (1.00,1.00)  ~ (p=0.108)
      BenchmarkFmtManyArgs              1.89µs × (1.00,1.01)    1.90µs × (0.94,1.02)  ~ (p=0.883)
      BenchmarkGobDecode                22.4ms × (0.99,1.01)    21.9ms × (0.92,1.04)  ~ (p=0.332)
      BenchmarkGobEncode                24.7ms × (0.98,1.02)    23.9ms × (0.87,1.07)  ~ (p=0.407)
      BenchmarkGzip                      397ms × (0.99,1.01)     398ms × (0.99,1.01)  ~ (p=0.718)
      BenchmarkGunzip                   96.7ms × (1.00,1.00)    96.9ms × (1.00,1.00)  ~ (p=0.230)
      BenchmarkHTTPClientServer         71.5µs × (0.98,1.01)    68.5µs × (0.92,1.06)  ~ (p=0.243)
      BenchmarkJSONEncode               46.1ms × (0.98,1.01)    44.9ms × (0.98,1.03)  -2.51% (p=0.040)
      BenchmarkJSONDecode               86.1ms × (0.99,1.01)    86.5ms × (0.99,1.01)  ~ (p=0.343)
      BenchmarkMandelbrot200            4.12ms × (1.00,1.00)    4.13ms × (1.00,1.00)  +0.23% (p=0.000)
      BenchmarkGoParse                  5.89ms × (0.96,1.03)    5.82ms × (0.96,1.04)  ~ (p=0.522)
      BenchmarkRegexpMatchEasy0_32       141ns × (0.99,1.01)     142ns × (1.00,1.00)  ~ (p=0.178)
      BenchmarkRegexpMatchEasy0_1K       408ns × (1.00,1.00)     392ns × (0.99,1.00)  -3.83% (p=0.000)
      BenchmarkRegexpMatchEasy1_32       122ns × (1.00,1.00)     122ns × (1.00,1.00)  ~ (p=0.178)
      BenchmarkRegexpMatchEasy1_1K       626ns × (1.00,1.01)     624ns × (0.99,1.00)  ~ (p=0.122)
      BenchmarkRegexpMatchMedium_32      202ns × (0.99,1.00)     205ns × (0.99,1.01)  +1.58% (p=0.001)
      BenchmarkRegexpMatchMedium_1K     54.4µs × (1.00,1.00)    55.5µs × (1.00,1.00)  +1.86% (p=0.000)
      BenchmarkRegexpMatchHard_32       2.68µs × (1.00,1.00)    2.71µs × (1.00,1.00)  +0.97% (p=0.002)
      BenchmarkRegexpMatchHard_1K       79.8µs × (1.00,1.01)    80.5µs × (1.00,1.01)  +0.94% (p=0.003)
      BenchmarkRevcomp                   590ms × (0.99,1.01)     585ms × (1.00,1.00)  ~ (p=0.066)
      BenchmarkTemplate                  111ms × (0.97,1.02)     112ms × (0.99,1.01)  ~ (p=0.201)
      BenchmarkTimeParse                 392ns × (1.00,1.00)     385ns × (1.00,1.00)  -1.69% (p=0.000)
      BenchmarkTimeFormat                449ns × (0.98,1.01)     448ns × (0.99,1.01)  ~ (p=0.550)
      
      Change-Id: Ie7c3830c481d96c9043e7bf26853c6c1d05dc9f4
      Reviewed-on: https://go-review.googlesource.com/9364Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      63caec5d
    • David Crawshaw's avatar
      cmd/internal/ld: remove Biobuf unget · 05d53165
      David Crawshaw authored
      The underlying *bufio.Reader does everything that's needed here.
      
      Change-Id: If0712a5b4d3142ae4bceaa2efe287eaf2b91e54e
      Reviewed-on: https://go-review.googlesource.com/9365Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      05d53165
    • Russ Cox's avatar
      doc/go1.5.txt: mention goroutine scheduling change · cbbe9f63
      Russ Cox authored
      Change-Id: I43a40f0c10472b3126c06b0d4268b32b54665f12
      Reviewed-on: https://go-review.googlesource.com/9349Reviewed-by: default avatarRob Pike <r@golang.org>
      cbbe9f63
    • Josh Bleecher Snyder's avatar
      Revert "Revert "cmd/dist: consolidate runtime CPU tests"" · 45ccea71
      Josh Bleecher Snyder authored
      This reverts commit 81c2233b.
      
      Change-Id: Ie7024f04dba6352ae79ba68d4da5c0c25844cd8c
      Reviewed-on: https://go-review.googlesource.com/9397Reviewed-by: default avatarDave Cheney <dave@cheney.net>
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      45ccea71
    • Russ Cox's avatar
      cmd/internal/gc: emit typedmemmove write barrier from sgen · 2a735590
      Russ Cox authored
      Emitting it here instead of rewriting the tree earlier sets us up
      to generate an inline check, like we do for single pointers.
      But even without the inline check, generating at this level lets
      us generate significantly more efficient code, probably due to
      having fewer temporaries and less complex high-level code
      for the compiler to churn through.
      
      Revcomp is worse, almost certainly due to register pressure.
      
      name                                       old                     new          delta
      BenchmarkBinaryTree17              18.0s × (0.99,1.01)     18.0s × (0.99,1.01)  ~
      BenchmarkFannkuch11                4.43s × (1.00,1.00)     4.36s × (1.00,1.00)  -1.44%
      BenchmarkFmtFprintfEmpty           114ns × (0.95,1.05)      86ns × (0.97,1.06)  -24.12%
      BenchmarkFmtFprintfString          468ns × (0.99,1.01)     420ns × (0.99,1.02)  -10.16%
      BenchmarkFmtFprintfInt             433ns × (1.00,1.01)     386ns × (0.99,1.02)  -10.74%
      BenchmarkFmtFprintfIntInt          748ns × (0.99,1.01)     647ns × (0.99,1.01)  -13.56%
      BenchmarkFmtFprintfPrefixedInt     547ns × (0.99,1.01)     499ns × (0.99,1.02)  -8.78%
      BenchmarkFmtFprintfFloat           756ns × (1.00,1.01)     689ns × (1.00,1.00)  -8.86%
      BenchmarkFmtManyArgs              2.79µs × (1.00,1.01)    2.53µs × (1.00,1.00)  -9.30%
      BenchmarkGobDecode                39.6ms × (0.99,1.00)    39.2ms × (0.98,1.01)  -1.07%
      BenchmarkGobEncode                37.6ms × (1.00,1.01)    37.5ms × (0.99,1.01)  ~
      BenchmarkGzip                      663ms × (0.99,1.02)     660ms × (0.98,1.01)  ~
      BenchmarkGunzip                    142ms × (1.00,1.00)     143ms × (1.00,1.00)  ~
      BenchmarkHTTPClientServer          132µs × (0.99,1.01)     133µs × (0.99,1.02)  ~
      BenchmarkJSONEncode               56.2ms × (0.99,1.01)    54.0ms × (0.98,1.01)  -3.97%
      BenchmarkJSONDecode                138ms × (1.00,1.00)     134ms × (0.99,1.02)  -2.70%
      BenchmarkMandelbrot200            6.03ms × (1.00,1.01)    6.00ms × (1.00,1.01)  ~
      BenchmarkGoParse                  9.82ms × (0.93,1.10)   10.35ms × (0.88,1.11)  ~
      BenchmarkRegexpMatchEasy0_32       207ns × (1.00,1.00)     163ns × (0.99,1.01)  -21.26%
      BenchmarkRegexpMatchEasy0_1K       581ns × (1.00,1.01)     566ns × (0.99,1.00)  -2.50%
      BenchmarkRegexpMatchEasy1_32       185ns × (0.99,1.01)     138ns × (1.00,1.01)  -25.41%
      BenchmarkRegexpMatchEasy1_1K       975ns × (1.00,1.01)     892ns × (1.00,1.00)  -8.51%
      BenchmarkRegexpMatchMedium_32      328ns × (0.99,1.00)     252ns × (1.00,1.00)  -23.17%
      BenchmarkRegexpMatchMedium_1K     88.6µs × (1.00,1.01)    73.0µs × (1.00,1.01)  -17.66%
      BenchmarkRegexpMatchHard_32       4.69µs × (0.95,1.03)    3.85µs × (1.00,1.01)  -17.91%
      BenchmarkRegexpMatchHard_1K        133µs × (1.00,1.01)     117µs × (1.00,1.00)  -12.34%
      BenchmarkRevcomp                   902ms × (0.99,1.05)    1001ms × (0.94,1.01)  +11.04%
      BenchmarkTemplate                  174ms × (0.99,1.01)     160ms × (0.99,1.01)  -7.70%
      BenchmarkTimeParse                 639ns × (1.00,1.00)     622ns × (1.00,1.00)  -2.66%
      BenchmarkTimeFormat                736ns × (1.00,1.01)     736ns × (1.00,1.02)  ~
      
      Change-Id: Ib3bbeb379f5f4819e6f5dcf69bc88a2b7ed41460
      Reviewed-on: https://go-review.googlesource.com/9225Reviewed-by: default avatarAustin Clements <austin@google.com>
      Run-TryBot: Russ Cox <rsc@golang.org>
      2a735590
    • Russ Cox's avatar
      cmd/internal/gc: inline writeBarrierEnabled check before calling writebarrierptr · 653d5607
      Russ Cox authored
      I believe the benchmarks that get slower are under register pressure,
      and not making the call unconditionally makes the pressure worse,
      and the register allocator doesn't do a great job. But part of the point
      of this sequence is to get the write barriers out of the way so I can work
      on the register allocator, so that's okay.
      
      name                                       old                     new          delta
      BenchmarkBinaryTree17              17.9s × (1.00,1.01)     18.0s × (0.99,1.01)  ~
      BenchmarkFannkuch11                4.43s × (1.00,1.00)     4.43s × (1.00,1.00)  ~
      BenchmarkFmtFprintfEmpty           110ns × (1.00,1.06)     114ns × (0.95,1.05)  ~
      BenchmarkFmtFprintfString          487ns × (0.99,1.00)     468ns × (0.99,1.01)  -4.00%
      BenchmarkFmtFprintfInt             450ns × (0.99,1.00)     433ns × (1.00,1.01)  -3.88%
      BenchmarkFmtFprintfIntInt          762ns × (1.00,1.00)     748ns × (0.99,1.01)  -1.84%
      BenchmarkFmtFprintfPrefixedInt     584ns × (0.99,1.01)     547ns × (0.99,1.01)  -6.26%
      BenchmarkFmtFprintfFloat           738ns × (1.00,1.00)     756ns × (1.00,1.01)  +2.37%
      BenchmarkFmtManyArgs              2.80µs × (1.00,1.01)    2.79µs × (1.00,1.01)  ~
      BenchmarkGobDecode                39.0ms × (0.99,1.00)    39.6ms × (0.99,1.00)  +1.54%
      BenchmarkGobEncode                37.8ms × (0.98,1.01)    37.6ms × (1.00,1.01)  ~
      BenchmarkGzip                      661ms × (0.99,1.01)     663ms × (0.99,1.02)  ~
      BenchmarkGunzip                    142ms × (1.00,1.00)     142ms × (1.00,1.00)  ~
      BenchmarkHTTPClientServer          132µs × (0.99,1.01)     132µs × (0.99,1.01)  ~
      BenchmarkJSONEncode               56.3ms × (0.99,1.01)    56.2ms × (0.99,1.01)  ~
      BenchmarkJSONDecode                138ms × (0.99,1.01)     138ms × (1.00,1.00)  ~
      BenchmarkMandelbrot200            6.01ms × (1.00,1.00)    6.03ms × (1.00,1.01)  +0.23%
      BenchmarkGoParse                  10.2ms × (0.87,1.05)     9.8ms × (0.93,1.10)  ~
      BenchmarkRegexpMatchEasy0_32       208ns × (1.00,1.00)     207ns × (1.00,1.00)  ~
      BenchmarkRegexpMatchEasy0_1K       588ns × (1.00,1.00)     581ns × (1.00,1.01)  -1.27%
      BenchmarkRegexpMatchEasy1_32       182ns × (0.99,1.01)     185ns × (0.99,1.01)  +1.65%
      BenchmarkRegexpMatchEasy1_1K       986ns × (1.00,1.01)     975ns × (1.00,1.01)  -1.17%
      BenchmarkRegexpMatchMedium_32      323ns × (1.00,1.01)     328ns × (0.99,1.00)  +1.55%
      BenchmarkRegexpMatchMedium_1K     89.9µs × (1.00,1.00)    88.6µs × (1.00,1.01)  -1.38%
      BenchmarkRegexpMatchHard_32       4.72µs × (0.95,1.01)    4.69µs × (0.95,1.03)  ~
      BenchmarkRegexpMatchHard_1K        133µs × (1.00,1.01)     133µs × (1.00,1.01)  ~
      BenchmarkRevcomp                   900ms × (1.00,1.05)     902ms × (0.99,1.05)  ~
      BenchmarkTemplate                  168ms × (0.99,1.01)     174ms × (0.99,1.01)  +3.30%
      BenchmarkTimeParse                 637ns × (1.00,1.00)     639ns × (1.00,1.00)  +0.31%
      BenchmarkTimeFormat                738ns × (1.00,1.00)     736ns × (1.00,1.01)  ~
      
      Change-Id: I03ce152852edec404538f6c20eb650fac82e2aa2
      Reviewed-on: https://go-review.googlesource.com/9224Reviewed-by: default avatarAustin Clements <austin@google.com>
      653d5607
    • Russ Cox's avatar
      runtime: replace needwb() with writeBarrierEnabled · 32d6fbcb
      Russ Cox authored
      Reduce the write barrier check to a single load and compare
      so that it can be inlined into write barrier use sites.
      Makes the standard write barrier a little faster too.
      
      name                                       old                     new          delta
      BenchmarkBinaryTree17              17.9s × (0.99,1.01)     17.9s × (1.00,1.01)  ~
      BenchmarkFannkuch11                4.35s × (1.00,1.00)     4.43s × (1.00,1.00)  +1.81%
      BenchmarkFmtFprintfEmpty           120ns × (0.93,1.06)     110ns × (1.00,1.06)  -7.92%
      BenchmarkFmtFprintfString          479ns × (0.99,1.00)     487ns × (0.99,1.00)  +1.67%
      BenchmarkFmtFprintfInt             452ns × (0.99,1.02)     450ns × (0.99,1.00)  ~
      BenchmarkFmtFprintfIntInt          766ns × (0.99,1.01)     762ns × (1.00,1.00)  ~
      BenchmarkFmtFprintfPrefixedInt     576ns × (0.98,1.01)     584ns × (0.99,1.01)  ~
      BenchmarkFmtFprintfFloat           730ns × (1.00,1.01)     738ns × (1.00,1.00)  +1.16%
      BenchmarkFmtManyArgs              2.84µs × (0.99,1.00)    2.80µs × (1.00,1.01)  -1.22%
      BenchmarkGobDecode                39.3ms × (0.98,1.01)    39.0ms × (0.99,1.00)  ~
      BenchmarkGobEncode                39.5ms × (0.99,1.01)    37.8ms × (0.98,1.01)  -4.33%
      BenchmarkGzip                      663ms × (1.00,1.01)     661ms × (0.99,1.01)  ~
      BenchmarkGunzip                    143ms × (1.00,1.00)     142ms × (1.00,1.00)  ~
      BenchmarkHTTPClientServer          132µs × (0.99,1.01)     132µs × (0.99,1.01)  ~
      BenchmarkJSONEncode               57.4ms × (0.99,1.01)    56.3ms × (0.99,1.01)  -1.96%
      BenchmarkJSONDecode                139ms × (0.99,1.00)     138ms × (0.99,1.01)  ~
      BenchmarkMandelbrot200            6.03ms × (1.00,1.00)    6.01ms × (1.00,1.00)  ~
      BenchmarkGoParse                  10.3ms × (0.89,1.14)    10.2ms × (0.87,1.05)  ~
      BenchmarkRegexpMatchEasy0_32       209ns × (1.00,1.00)     208ns × (1.00,1.00)  ~
      BenchmarkRegexpMatchEasy0_1K       591ns × (0.99,1.00)     588ns × (1.00,1.00)  ~
      BenchmarkRegexpMatchEasy1_32       184ns × (0.99,1.02)     182ns × (0.99,1.01)  ~
      BenchmarkRegexpMatchEasy1_1K      1.01µs × (1.00,1.00)    0.99µs × (1.00,1.01)  -2.33%
      BenchmarkRegexpMatchMedium_32      330ns × (1.00,1.00)     323ns × (1.00,1.01)  -2.12%
      BenchmarkRegexpMatchMedium_1K     92.6µs × (1.00,1.00)    89.9µs × (1.00,1.00)  -2.92%
      BenchmarkRegexpMatchHard_32       4.80µs × (0.95,1.00)    4.72µs × (0.95,1.01)  ~
      BenchmarkRegexpMatchHard_1K        136µs × (1.00,1.00)     133µs × (1.00,1.01)  -1.86%
      BenchmarkRevcomp                   900ms × (0.99,1.04)     900ms × (1.00,1.05)  ~
      BenchmarkTemplate                  172ms × (1.00,1.00)     168ms × (0.99,1.01)  -2.07%
      BenchmarkTimeParse                 637ns × (1.00,1.00)     637ns × (1.00,1.00)  ~
      BenchmarkTimeFormat                744ns × (1.00,1.01)     738ns × (1.00,1.00)  -0.67%
      
      Change-Id: I4ecc925805da1f5ee264377f1f7574f54ee575e7
      Reviewed-on: https://go-review.googlesource.com/9321Reviewed-by: default avatarAustin Clements <austin@google.com>
      32d6fbcb
    • Russ Cox's avatar
      runtime: change unused argument in fat write barriers from pointer to scalar · 2050f571
      Russ Cox authored
      The argument is unused, only present for alignment of the
      following argument. The compiler today always passes a zero
      but I'd rather not write anything there during the call sequence,
      so mark it as a scalar so the garbage collector won't look at it.
      
      As expected, no significant performance change.
      
      name                                       old                     new          delta
      BenchmarkBinaryTree17              17.9s × (0.99,1.00)     17.9s × (0.99,1.01)  ~
      BenchmarkFannkuch11                4.35s × (1.00,1.00)     4.35s × (1.00,1.00)  ~
      BenchmarkFmtFprintfEmpty           120ns × (0.94,1.05)     120ns × (0.93,1.06)  ~
      BenchmarkFmtFprintfString          477ns × (1.00,1.00)     479ns × (0.99,1.00)  ~
      BenchmarkFmtFprintfInt             450ns × (0.99,1.01)     452ns × (0.99,1.02)  ~
      BenchmarkFmtFprintfIntInt          765ns × (0.99,1.01)     766ns × (0.99,1.01)  ~
      BenchmarkFmtFprintfPrefixedInt     569ns × (0.99,1.01)     576ns × (0.98,1.01)  ~
      BenchmarkFmtFprintfFloat           728ns × (1.00,1.00)     730ns × (1.00,1.01)  ~
      BenchmarkFmtManyArgs              2.82µs × (0.99,1.01)    2.84µs × (0.99,1.00)  ~
      BenchmarkGobDecode                39.1ms × (0.99,1.01)    39.3ms × (0.98,1.01)  ~
      BenchmarkGobEncode                39.4ms × (0.99,1.01)    39.5ms × (0.99,1.01)  ~
      BenchmarkGzip                      661ms × (0.99,1.01)     663ms × (1.00,1.01)  ~
      BenchmarkGunzip                    143ms × (1.00,1.00)     143ms × (1.00,1.00)  ~
      BenchmarkHTTPClientServer          133µs × (0.99,1.01)     132µs × (0.99,1.01)  ~
      BenchmarkJSONEncode               57.3ms × (0.99,1.04)    57.4ms × (0.99,1.01)  ~
      BenchmarkJSONDecode                139ms × (0.99,1.00)     139ms × (0.99,1.00)  ~
      BenchmarkMandelbrot200            6.02ms × (1.00,1.00)    6.03ms × (1.00,1.00)  ~
      BenchmarkGoParse                  9.72ms × (0.92,1.11)   10.31ms × (0.89,1.14)  ~
      BenchmarkRegexpMatchEasy0_32       209ns × (1.00,1.01)     209ns × (1.00,1.00)  ~
      BenchmarkRegexpMatchEasy0_1K       592ns × (0.99,1.00)     591ns × (0.99,1.00)  ~
      BenchmarkRegexpMatchEasy1_32       183ns × (0.98,1.01)     184ns × (0.99,1.02)  ~
      BenchmarkRegexpMatchEasy1_1K      1.01µs × (1.00,1.01)    1.01µs × (1.00,1.00)  ~
      BenchmarkRegexpMatchMedium_32      330ns × (1.00,1.00)     330ns × (1.00,1.00)  ~
      BenchmarkRegexpMatchMedium_1K     92.4µs × (1.00,1.00)    92.6µs × (1.00,1.00)  ~
      BenchmarkRegexpMatchHard_32       4.77µs × (0.95,1.01)    4.80µs × (0.95,1.00)  ~
      BenchmarkRegexpMatchHard_1K        136µs × (1.00,1.00)     136µs × (1.00,1.00)  ~
      BenchmarkRevcomp                   906ms × (0.99,1.05)     900ms × (0.99,1.04)  ~
      BenchmarkTemplate                  171ms × (0.99,1.01)     172ms × (1.00,1.00)  ~
      BenchmarkTimeParse                 638ns × (1.00,1.00)     637ns × (1.00,1.00)  ~
      BenchmarkTimeFormat                745ns × (0.99,1.02)     744ns × (1.00,1.01)  ~
      
      Change-Id: I0aeac5dc7adfd75e2223e3aabfedc7818d339f9b
      Reviewed-on: https://go-review.googlesource.com/9320Reviewed-by: default avatarAustin Clements <austin@google.com>
      2050f571
    • Russ Cox's avatar
      cmd/internal/gc: accept comma-separated list of name=value for -d · 6c328efc
      Russ Cox authored
      This should obviously have no performance impact.
      Listing numbers just as a sanity check for the benchmark
      comparison program: it should (and does) find nothing
      to report.
      
      name                                       old                     new          delta
      BenchmarkBinaryTree17              18.0s × (0.99,1.01)     17.9s × (0.99,1.00)  ~
      BenchmarkFannkuch11                4.36s × (1.00,1.00)     4.35s × (1.00,1.00)  ~
      BenchmarkFmtFprintfEmpty           120ns × (0.99,1.06)     120ns × (0.94,1.05)  ~
      BenchmarkFmtFprintfString          480ns × (0.99,1.01)     477ns × (1.00,1.00)  ~
      BenchmarkFmtFprintfInt             451ns × (0.99,1.01)     450ns × (0.99,1.01)  ~
      BenchmarkFmtFprintfIntInt          766ns × (0.99,1.01)     765ns × (0.99,1.01)  ~
      BenchmarkFmtFprintfPrefixedInt     569ns × (0.99,1.01)     569ns × (0.99,1.01)  ~
      BenchmarkFmtFprintfFloat           728ns × (1.00,1.01)     728ns × (1.00,1.00)  ~
      BenchmarkFmtManyArgs              2.81µs × (1.00,1.01)    2.82µs × (0.99,1.01)  ~
      BenchmarkGobDecode                39.4ms × (0.99,1.01)    39.1ms × (0.99,1.01)  ~
      BenchmarkGobEncode                39.4ms × (0.99,1.00)    39.4ms × (0.99,1.01)  ~
      BenchmarkGzip                      660ms × (1.00,1.01)     661ms × (0.99,1.01)  ~
      BenchmarkGunzip                    143ms × (1.00,1.00)     143ms × (1.00,1.00)  ~
      BenchmarkHTTPClientServer          132µs × (0.99,1.01)     133µs × (0.99,1.01)  ~
      BenchmarkJSONEncode               57.1ms × (0.99,1.01)    57.3ms × (0.99,1.04)  ~
      BenchmarkJSONDecode                138ms × (1.00,1.01)     139ms × (0.99,1.00)  ~
      BenchmarkMandelbrot200            6.02ms × (1.00,1.00)    6.02ms × (1.00,1.00)  ~
      BenchmarkGoParse                  9.79ms × (0.92,1.07)    9.72ms × (0.92,1.11)  ~
      BenchmarkRegexpMatchEasy0_32       210ns × (1.00,1.01)     209ns × (1.00,1.01)  ~
      BenchmarkRegexpMatchEasy0_1K       593ns × (0.99,1.01)     592ns × (0.99,1.00)  ~
      BenchmarkRegexpMatchEasy1_32       182ns × (0.99,1.01)     183ns × (0.98,1.01)  ~
      BenchmarkRegexpMatchEasy1_1K      1.01µs × (1.00,1.01)    1.01µs × (1.00,1.01)  ~
      BenchmarkRegexpMatchMedium_32      331ns × (1.00,1.00)     330ns × (1.00,1.00)  ~
      BenchmarkRegexpMatchMedium_1K     92.6µs × (1.00,1.01)    92.4µs × (1.00,1.00)  ~
      BenchmarkRegexpMatchHard_32       4.58µs × (0.99,1.05)    4.77µs × (0.95,1.01)  ~
      BenchmarkRegexpMatchHard_1K        136µs × (1.00,1.01)     136µs × (1.00,1.00)  ~
      BenchmarkRevcomp                   900ms × (0.99,1.06)     906ms × (0.99,1.05)  ~
      BenchmarkTemplate                  171ms × (1.00,1.01)     171ms × (0.99,1.01)  ~
      BenchmarkTimeParse                 637ns × (1.00,1.00)     638ns × (1.00,1.00)  ~
      BenchmarkTimeFormat                742ns × (1.00,1.00)     745ns × (0.99,1.02)  ~
      
      Change-Id: I59ec875715cb176bbffa709546370a6a7fc5a75d
      Reviewed-on: https://go-review.googlesource.com/9309Reviewed-by: default avatarAustin Clements <austin@google.com>
      6c328efc
    • Russ Cox's avatar
      cmd/internal/gc: use MOV R0, R1 instead of LEA 0(R0), R1 in Agen · 0f0bc0f0
      Russ Cox authored
      Minor code generation optimization I've been meaning to do
      for a while and noticed while working on the emitted write
      barrier code. Using MOV lets the compiler and maybe the
      processor do copy propagation.
      
      name                                       old                     new          delta
      BenchmarkBinaryTree17              17.9s × (0.99,1.01)     18.0s × (0.99,1.01)  ~
      BenchmarkFannkuch11                4.42s × (1.00,1.00)     4.36s × (1.00,1.00)  -1.39%
      BenchmarkFmtFprintfEmpty           118ns × (0.96,1.02)     120ns × (0.99,1.06)  ~
      BenchmarkFmtFprintfString          486ns × (0.99,1.01)     480ns × (0.99,1.01)  -1.34%
      BenchmarkFmtFprintfInt             457ns × (0.99,1.01)     451ns × (0.99,1.01)  -1.31%
      BenchmarkFmtFprintfIntInt          768ns × (1.00,1.01)     766ns × (0.99,1.01)  ~
      BenchmarkFmtFprintfPrefixedInt     584ns × (0.99,1.03)     569ns × (0.99,1.01)  -2.57%
      BenchmarkFmtFprintfFloat           739ns × (0.99,1.00)     728ns × (1.00,1.01)  -1.49%
      BenchmarkFmtManyArgs              2.77µs × (1.00,1.00)    2.81µs × (1.00,1.01)  +1.53%
      BenchmarkGobDecode                39.3ms × (0.99,1.01)    39.4ms × (0.99,1.01)  ~
      BenchmarkGobEncode                39.4ms × (0.99,1.00)    39.4ms × (0.99,1.00)  ~
      BenchmarkGzip                      661ms × (0.99,1.01)     660ms × (1.00,1.01)  ~
      BenchmarkGunzip                    142ms × (1.00,1.00)     143ms × (1.00,1.00)  +0.20%
      BenchmarkHTTPClientServer          133µs × (0.98,1.01)     132µs × (0.99,1.01)  ~
      BenchmarkJSONEncode               56.5ms × (0.99,1.01)    57.1ms × (0.99,1.01)  +0.94%
      BenchmarkJSONDecode                143ms × (1.00,1.00)     138ms × (1.00,1.01)  -3.22%
      BenchmarkMandelbrot200            6.01ms × (1.00,1.00)    6.02ms × (1.00,1.00)  ~
      BenchmarkGoParse                  9.63ms × (0.94,1.07)    9.79ms × (0.92,1.07)  ~
      BenchmarkRegexpMatchEasy0_32       210ns × (1.00,1.00)     210ns × (1.00,1.01)  ~
      BenchmarkRegexpMatchEasy0_1K       596ns × (0.99,1.01)     593ns × (0.99,1.01)  ~
      BenchmarkRegexpMatchEasy1_32       184ns × (0.99,1.01)     182ns × (0.99,1.01)  ~
      BenchmarkRegexpMatchEasy1_1K      1.01µs × (0.99,1.01)    1.01µs × (1.00,1.01)  ~
      BenchmarkRegexpMatchMedium_32      327ns × (1.00,1.01)     331ns × (1.00,1.00)  +1.22%
      BenchmarkRegexpMatchMedium_1K     93.0µs × (1.00,1.02)    92.6µs × (1.00,1.01)  ~
      BenchmarkRegexpMatchHard_32       4.76µs × (0.95,1.01)    4.58µs × (0.99,1.05)  ~
      BenchmarkRegexpMatchHard_1K        136µs × (1.00,1.01)     136µs × (1.00,1.01)  ~
      BenchmarkRevcomp                   892ms × (1.00,1.01)     900ms × (0.99,1.06)  ~
      BenchmarkTemplate                  175ms × (0.99,1.00)     171ms × (1.00,1.01)  -2.36%
      BenchmarkTimeParse                 638ns × (1.00,1.00)     637ns × (1.00,1.00)  ~
      BenchmarkTimeFormat                772ns × (1.00,1.00)     742ns × (1.00,1.00)  -3.95%
      
      Change-Id: I6504e310cb9cf48a73d539c478b4dbcacde208b2
      Reviewed-on: https://go-review.googlesource.com/9308Reviewed-by: default avatarAustin Clements <austin@google.com>
      0f0bc0f0
    • Russ Cox's avatar
      cmd/internal/gc: emit write barriers at lower level · 0ad4f8b1
      Russ Cox authored
      This is primarily preparation for inlining, not an optimization by itself,
      but it still helps some.
      
      name                                       old                     new          delta
      BenchmarkBinaryTree17              18.2s × (0.99,1.01)     17.9s × (0.99,1.01)  -1.57%
      BenchmarkFannkuch11                4.44s × (1.00,1.00)     4.42s × (1.00,1.00)  -0.40%
      BenchmarkFmtFprintfEmpty           119ns × (0.95,1.02)     118ns × (0.96,1.02)  ~
      BenchmarkFmtFprintfString          501ns × (0.99,1.02)     486ns × (0.99,1.01)  -2.89%
      BenchmarkFmtFprintfInt             474ns × (0.99,1.00)     457ns × (0.99,1.01)  -3.59%
      BenchmarkFmtFprintfIntInt          792ns × (1.00,1.00)     768ns × (1.00,1.01)  -3.03%
      BenchmarkFmtFprintfPrefixedInt     574ns × (1.00,1.01)     584ns × (0.99,1.03)  +1.83%
      BenchmarkFmtFprintfFloat           749ns × (1.00,1.00)     739ns × (0.99,1.00)  -1.34%
      BenchmarkFmtManyArgs              2.94µs × (1.00,1.01)    2.77µs × (1.00,1.00)  -5.76%
      BenchmarkGobDecode                39.5ms × (0.99,1.01)    39.3ms × (0.99,1.01)  ~
      BenchmarkGobEncode                39.4ms × (1.00,1.01)    39.4ms × (0.99,1.00)  ~
      BenchmarkGzip                      658ms × (1.00,1.01)     661ms × (0.99,1.01)  ~
      BenchmarkGunzip                    142ms × (1.00,1.00)     142ms × (1.00,1.00)  +0.22%
      BenchmarkHTTPClientServer          134µs × (0.99,1.01)     133µs × (0.98,1.01)  ~
      BenchmarkJSONEncode               57.1ms × (0.99,1.01)    56.5ms × (0.99,1.01)  ~
      BenchmarkJSONDecode                141ms × (1.00,1.00)     143ms × (1.00,1.00)  +1.09%
      BenchmarkMandelbrot200            6.01ms × (1.00,1.00)    6.01ms × (1.00,1.00)  ~
      BenchmarkGoParse                  10.1ms × (0.91,1.09)     9.6ms × (0.94,1.07)  ~
      BenchmarkRegexpMatchEasy0_32       207ns × (1.00,1.01)     210ns × (1.00,1.00)  +1.45%
      BenchmarkRegexpMatchEasy0_1K       592ns × (0.99,1.00)     596ns × (0.99,1.01)  +0.68%
      BenchmarkRegexpMatchEasy1_32       184ns × (0.99,1.01)     184ns × (0.99,1.01)  ~
      BenchmarkRegexpMatchEasy1_1K      1.01µs × (1.00,1.00)    1.01µs × (0.99,1.01)  ~
      BenchmarkRegexpMatchMedium_32      327ns × (0.99,1.00)     327ns × (1.00,1.01)  ~
      BenchmarkRegexpMatchMedium_1K     92.5µs × (1.00,1.00)    93.0µs × (1.00,1.02)  +0.48%
      BenchmarkRegexpMatchHard_32       4.79µs × (0.95,1.00)    4.76µs × (0.95,1.01)  ~
      BenchmarkRegexpMatchHard_1K        136µs × (1.00,1.00)     136µs × (1.00,1.01)  ~
      BenchmarkRevcomp                   900ms × (0.99,1.01)     892ms × (1.00,1.01)  ~
      BenchmarkTemplate                  170ms × (0.99,1.01)     175ms × (0.99,1.00)  +2.95%
      BenchmarkTimeParse                 645ns × (1.00,1.00)     638ns × (1.00,1.00)  -1.16%
      BenchmarkTimeFormat                740ns × (1.00,1.00)     772ns × (1.00,1.00)  +4.39%
      
      Change-Id: I0be905e32791e0cb70ff01f169c4b309a971d981
      Reviewed-on: https://go-review.googlesource.com/9159Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      0ad4f8b1
    • Josh Bleecher Snyder's avatar
      test: gofmt run.go · 673bd188
      Josh Bleecher Snyder authored
      Clean up after CL 5310.
      
      Change-Id: Ib870e7b9d26eb118eefdaa3e76dcec4a4d459584
      Reviewed-on: https://go-review.googlesource.com/9398Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      673bd188
    • Josh Bleecher Snyder's avatar
      test: set GOMAXPROCS=1 in fixedbugs/issue9110 · 1fb948a0
      Josh Bleecher Snyder authored
      With this fix,
      
      GOMAXPROCS=8 ./all.bash
      
      passes, at least on my machine.
      
      Fixes #10216.
      
      Change-Id: Ib5991950892a1399ec81aced0a52b435e6f83fdf
      Reviewed-on: https://go-review.googlesource.com/9392Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      1fb948a0
    • Mikio Hara's avatar
      net: don't miss testing server teardowns when test fails early · 9bef5cfb
      Mikio Hara authored
      Change-Id: I9fa678e43b4ae3970323cac474b5f86d4d933997
      Reviewed-on: https://go-review.googlesource.com/9382Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      9bef5cfb
  2. 27 Apr, 2015 21 commits
    • Matthew Dempsky's avatar
      test: reenable syntax tests · 8a413752
      Matthew Dempsky authored
      These were fixed a little while ago, but overlooked when reenabling
      disabled tests.
      
      Update #9968.
      
      Change-Id: I301ef587e580c517a170ad08ff897118b58cedec
      Reviewed-on: https://go-review.googlesource.com/9347
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      8a413752
    • Rob Pike's avatar
      doc/go1.5.txt: go doc · 181e81cf
      Rob Pike authored
      Change-Id: I883017b67e8fa76b6f123e8f9bcec3d6f820bbb3
      Reviewed-on: https://go-review.googlesource.com/9348Reviewed-by: default avatarRob Pike <r@golang.org>
      181e81cf
    • Rob Pike's avatar
      cmd/go,cmd/doc: add "go doc" · a5de54a8
      Rob Pike authored
      Add the new go doc command to the go command, installed in
      the tool directory.
      
      (Still to do: tests)
      
      Fix cmd/dist to remove old "package documentation" code that was
      stopping it from including cmd/go/doc.go in the build.
      
      Implement the doc command. Here is the help info from "go help doc":
      
      ===
      usage: go doc [-u] [package|[package.]symbol[.method]]
      
      Doc accepts at most one argument, indicating either a package, a symbol within a
      package, or a method of a symbol.
      
      	go doc
      	go doc <pkg>
      	go doc <sym>[.<method>]
      	go doc [<pkg>].<sym>[.<method>]
      
      Doc interprets the argument to see what it represents, determined by its syntax
      and which packages and symbols are present in the source directories of GOROOT and
      GOPATH.
      
      The first item in this list that succeeds is the one whose documentation is printed.
      For packages, the order of scanning is determined by the file system, however the
      GOROOT tree is always scanned before GOPATH.
      
      If there is no package specified or matched, the package in the current directory
      is selected, so "go doc" shows the documentation for the current package and
      "go doc Foo" shows the documentation for symbol Foo in the current package.
      
      Doc prints the documentation comments associated with the top-level item the
      argument identifies (package, type, method) followed by a one-line summary of each
      of the first-level items "under" that item (package-level declarations for a
      package, methods for a type, etc.)
      
      The package paths must be either a qualified path or a proper suffix of a path
      (see examples below). The go tool's usual package mechanism does not apply: package
      path elements like . and ...  are not implemented by go doc.
      
      When matching symbols, lower-case letters match either case but upper-case letters
      match exactly.
      
      Examples:
      	go doc
      		Show documentation for current package.
      	go doc Foo
      		Show documentation for Foo in the current package.
      		(Foo starts with a capital letter so it cannot match a package path.)
      	go doc json
      		Show documentation for the encoding/json package.
      	go doc json
      		Shorthand for encoding/json assuming only one json package
      		is present in the tree.
      	go doc json.Number (or go doc json.number)
      		Show documentation and method summary for json.Number.
      	go doc json.Number.Int64 (or go doc json.number.int64)
      		Show documentation for the Int64 method of json.Number.
      
      Flags:
      	-u
      		Show documentation for unexported as well as exported
      		symbols and methods.
      
      ===
      
      Still to do:
      
      Tests.
      Disambiguation when there is both foo and Foo.
      Flag for case-sensitive matching.
      
      Change-Id: I83d409a68688a5445f54297a7e7c745f749b9e66
      Reviewed-on: https://go-review.googlesource.com/9227Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      a5de54a8
    • Austin Clements's avatar
      runtime/race: fix failing tests · 02ba71e5
      Austin Clements authored
      Some race tests were sensitive to the goroutine scheduling order.
      When this changed in commit e870f06c, these tests started to fail.
      
      Fix TestRaceHeapParam by ensuring that the racing goroutine has
      run before the test exits. Fix TestRaceRWMutexMultipleReaders by
      adding a third reader to ensure that two readers wind up on the
      same side of the writer (and race with each other) regardless of
      the schedule. Fix TestRaceRange by ensuring that the racing
      goroutine runs before the main goroutine exits the loop it races
      with.
      
      Change-Id: Iaf002f8730ea42227feaf2f3c51b9a1e57ccffdd
      Reviewed-on: https://go-review.googlesource.com/9402Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      02ba71e5
    • Russ Cox's avatar
      runtime/race: stop listening to external network addresses · f774e6a1
      Russ Cox authored
      This makes the OS X firewall box pop up.
      Not run during all.bash so hasn't been noticed before.
      
      Change-Id: I78feb4fd3e1d3c983ae3419085048831c04de3da
      Reviewed-on: https://go-review.googlesource.com/9401Reviewed-by: default avatarAustin Clements <austin@google.com>
      f774e6a1
    • Austin Clements's avatar
      runtime: fix stack use accounting · 7c7cd695
      Austin Clements authored
      ReadMemStats accounts for stacks slightly differently than the runtime
      does internally. Internally, only stacks allocated by newosproc0 are
      accounted in memstats.stacks_sys and other stacks are accounted in
      heap_sys. readmemstats_m shuffles the statistics so all stacks are
      accounted in StackSys rather than HeapSys.
      
      However, currently, readmemstats_m assumes StackSys will be zero when
      it does this shuffle. This was true until commit 6ad33be2. If it isn't
      (e.g., if something called newosproc0), StackSys+HeapSys will be
      different before and after this shuffle, and the Sys sum that was
      computed earlier will no longer agree with the sum of its components.
      
      Fix this by making the shuffle in readmemstats_m not assume that
      StackSys is zero.
      
      Fixes #10585.
      
      Change-Id: If13991c8de68bd7b85e1b613d3f12b4fd6fd5813
      Reviewed-on: https://go-review.googlesource.com/9366Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      7c7cd695
    • David Crawshaw's avatar
      runtime: remove unnecessary noescape to fix netbsd · d707a6e0
      David Crawshaw authored
      I introduced this build failure in golang.org/cl/9302 but failed to
      notice due to the other failures on the dashboard.
      
      Change-Id: I84bf00f664ba572c1ca722e0136d8a2cf21613ca
      Reviewed-on: https://go-review.googlesource.com/9363Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarMinux Ma <minux@golang.org>
      d707a6e0
    • Josh Bleecher Snyder's avatar
      cmd/internal/gc, cmd/internal/ld: add memprofilerate flag · 00d4a6b3
      Josh Bleecher Snyder authored
      Also call runtime.GC before exit to ensure
      that the profiler picks up all allocations.
      
      Fixes #10537.
      
      Change-Id: Ibfbfc88652ac0ce30a6d1ae392f919df6c1e8126
      Reviewed-on: https://go-review.googlesource.com/9261Reviewed-by: default avatarDave Cheney <dave@cheney.net>
      Reviewed-by: default avatarMinux Ma <minux@golang.org>
      Run-TryBot: Minux Ma <minux@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      00d4a6b3
    • Austin Clements's avatar
      runtime/race: fix benchmark deadlock · 23ce80ef
      Austin Clements authored
      Currently TestRaceCrawl fails to wg.Done for every wg.Adds if the
      depth ever reaches 0. This causes the test to deadlock. Under the race
      detector, this deadlock is not detected, so the test eventually times
      out.
      
      This only recently became a problem. Prior to commit e870f06c the depth
      would never reach 0 because the strict round-robin goroutine schedule
      ensured that all of the URLs were already "seen" by depth 2. Now that
      the runtime prefers scheduling the most recently started goroutine,
      the test is able to reach depth 0 and trigger this deadlock.
      
      Change-Id: I5176302a89614a344c84d587073b364833af6590
      Reviewed-on: https://go-review.googlesource.com/9344
      Run-TryBot: Austin Clements <austin@google.com>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      23ce80ef
    • Dmitry Savintsev's avatar
      regexp: trivial change in comments to update code.google.com link · 8cb9c21c
      Dmitry Savintsev authored
      Replaced code.google.com/p/re2/ with github.com/google/re2/ and
      updated the file names (re2-exhaustive.txt.bz2 not re2.txt.gz)
      as well as the re2 make command (make log).
      
      Change-Id: I15937b0b8a898d78d45366857ed86421c8d69960
      Reviewed-on: https://go-review.googlesource.com/9372Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      8cb9c21c
    • Russ Cox's avatar
      runtime: fix race in BenchmarkPingPongHog · 42da2700
      Russ Cox authored
      The master goroutine was returning before
      the child goroutine had done its final i < b.N
      (the one that fails and causes it to exit the loop)
      and then the benchmark harness was updating
      b.N, causing a read+write race on b.N.
      
      Change-Id: I2504270a0de30544736f6c32161337a25b505c3e
      Reviewed-on: https://go-review.googlesource.com/9368Reviewed-by: default avatarAustin Clements <austin@google.com>
      42da2700
    • Austin Clements's avatar
      runtime: fix some out of date comments and typos · 33e0f3d8
      Austin Clements authored
      Change-Id: I061057414c722c5a0f03c709528afc8554114db6
      Reviewed-on: https://go-review.googlesource.com/9367Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      33e0f3d8
    • Josh Bleecher Snyder's avatar
      runtime: remove a modulus calculation from pollorder · 9a0fd97f
      Josh Bleecher Snyder authored
      This is a follow-up to CL 9269, as suggested
      by dvyukov.
      
      There is probably even more that can be done
      to speed up this shuffle. It will matter more
      once CL 7570 (fine-grained locking in select)
      is in and can be revisited then, with benchmarks.
      
      Change-Id: Ic13a27d11cedd1e1f007951214b3bb56b1644f02
      Reviewed-on: https://go-review.googlesource.com/9393Reviewed-by: default avatarDmitry Vyukov <dvyukov@google.com>
      9a0fd97f
    • Austin Clements's avatar
      runtime: rename gcController.findRunnable to findRunnableGCWorker · 1b01910c
      Austin Clements authored
      This avoids confusion with the main findrunnable in the scheduler.
      
      Change-Id: I8cf40657557a8610a2fe5a2f74598518256ca7f0
      Reviewed-on: https://go-review.googlesource.com/9305Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      1b01910c
    • Austin Clements's avatar
      runtime: replace STW for enabling write barriers with ragged barrier · bb632053
      Austin Clements authored
      Currently, we use a full stop-the-world around enabling write
      barriers. This is to ensure that all Gs have enabled write barriers
      before any blackening occurs (either in gcBgMarkWorker() or in
      gcAssistAlloc()).
      
      However, there's no need to bring the whole world to a synchronous
      stop to ensure this. This change replaces the STW with a ragged
      barrier that ensures each P has individually observed that write
      barriers should be enabled before GC performs any blackening.
      
      Change-Id: If2f129a6a55bd8bdd4308067af2b739f3fb41955
      Reviewed-on: https://go-review.googlesource.com/8207Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      bb632053
    • Austin Clements's avatar
      runtime: add ragged global barrier function · 57afa764
      Austin Clements authored
      This adds forEachP, which performs a general-purpose ragged global
      barrier. forEachP takes a callback and invokes it for every P at a GC
      safe point.
      
      Ps that are idle or in a syscall are considered to be at a continuous
      safe point. forEachP ensures that these Ps do not change state by
      forcing all syscall Ps into idle and holding the sched.lock.
      
      To ensure that Ps do not enter syscall or idle without running the
      safe-point function, this adds checks for a pending callback every
      place there is currently a gcwaiting check.
      
      We'll use forEachP to replace the STW around enabling the write
      barrier and to replace the current asynchronous per-M wbuf cache with
      a cooperatively managed per-P gcWork cache.
      
      Change-Id: Ie944f8ce1fead7c79bf271d2f42fcd61a41bb3cc
      Reviewed-on: https://go-review.googlesource.com/8206Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      57afa764
    • Josh Bleecher Snyder's avatar
      Revert "cmd/dist: consolidate runtime CPU tests" · 81c2233b
      Josh Bleecher Snyder authored
      This reverts commit a9e50a6b.
      
      Change-Id: I3c5e459f1030e36bc249910facdae12303a44151
      Reviewed-on: https://go-review.googlesource.com/9394Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      81c2233b
    • Josh Bleecher Snyder's avatar
      cmd/dist: consolidate runtime CPU tests · a9e50a6b
      Josh Bleecher Snyder authored
      Instead of running:
      
      go test -short runtime -cpu=1
      go test -short runtime -cpu=2
      go test -short runtime -cpu=4
      
      Run just:
      
      go test -short runtime -cpu=1,2,4
      
      This is a return to the Go 1.4.2 behavior.
      
      We lose incremental display of progress and
      per-cpu timing information, but we don't have
      to recompile and relink the runtime test,
      which is slow.
      
      This cuts about 10s off all.bash.
      
      Updates #10571.
      
      Change-Id: I6e8c7149780d47439f8bcfa888e6efc84290c60a
      Reviewed-on: https://go-review.googlesource.com/9350Reviewed-by: default avatarDave Cheney <dave@cheney.net>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      Reviewed-by: default avatarDmitry Vyukov <dvyukov@google.com>
      a9e50a6b
    • Josh Bleecher Snyder's avatar
      cmd/internal/ld: remove pointless allocs · 2692f483
      Josh Bleecher Snyder authored
      Reduces allocs linking cmd/go and runtime.test
      by ~13%. No functional changes.
      
      The most easily addressed sources of allocations
      after this are expandpkg, rdstring, and symbuf
      string conversion.
      
      These can be reduced by interning strings,
      but that increases the overall memory footprint.
      
      Change-Id: Ifedefc9f2a0403bcc75460d6b139e8408374e058
      Reviewed-on: https://go-review.googlesource.com/9391Reviewed-by: default avatarDavid Crawshaw <crawshaw@golang.org>
      2692f483
    • Roger Peppe's avatar
      encoding/xml: do not escape newlines · 4a3e000a
      Roger Peppe authored
      There is no need to escape newlines in char data -
      it makes the XML larger and harder to read.
      
      Change-Id: I1c1fcee1bdffc705c7428f89ca90af8085d6fb73
      Reviewed-on: https://go-review.googlesource.com/9310Reviewed-by: default avatarNigel Tao <nigeltao@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      4a3e000a
    • Austin Clements's avatar
      runtime: reset spinning in mspinning if work was ready()ed · b0b1a660
      Austin Clements authored
      This fixes a bug where the runtime ready()s a goroutine while setting
      up a new M that's initially marked as spinning, causing the scheduler
      to later panic when it finds work in the run queue of a P associated
      with a spinning M. Specifically, the sequence of events that can lead
      to this is:
      
      1) sysmon calls handoffp to hand off a P stolen from a syscall.
      
      2) handoffp sees no pending work on the P, so it calls startm with
         spinning set.
      
      3) startm calls newm, which in turn calls allocm to allocate a new M.
      
      4) allocm "borrows" the P we're handing off in order to do allocation
         and performs this allocation.
      
      5) This allocation may assist the garbage collector, and this assist
         may detect the end of concurrent mark and ready() the main GC
         goroutine to signal this.
      
      6) This ready()ing puts the GC goroutine on the run queue of the
         borrowed P.
      
      7) newm starts the OS thread, which runs mstart and subsequently
         mstart1, which marks the M spinning because startm was called with
         spinning set.
      
      8) mstart1 enters the scheduler, which panics because there's work on
         the run queue, but the M is marked spinning.
      
      To fix this, before marking the M spinning in step 7, add a check to
      see if work was been added to the P's run queue. If this is the case,
      undo the spinning instead.
      
      Fixes #10573.
      
      Change-Id: I4670495ae00582144a55ce88c45ae71de597cfa5
      Reviewed-on: https://go-review.googlesource.com/9332Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      Run-TryBot: Austin Clements <austin@google.com>
      b0b1a660