1. 25 Apr, 2019 9 commits
  2. 24 Apr, 2019 16 commits
  3. 23 Apr, 2019 15 commits
    • sergey's avatar
      net/url: Reduce allocation on parsing URL func · 601eee39
      sergey authored
      Build result string via string.Builder to avoid allocation.
      As side effect some performance boots.
      
      name                 old time/op    new time/op    delta
      QueryUnescape/#00-4     114ns ± 0%      98ns ± 1%  -13.89%  (p=0.000 n=4+5)
      QueryUnescape/#01-4     401ns ± 2%     383ns ± 1%   -4.54%  (p=0.008 n=5+5)
      QueryUnescape/#02-4     300ns ± 2%     274ns ± 2%   -8.66%  (p=0.008 n=5+5)
      QueryUnescape/#03-4     564ns ± 2%     542ns ± 2%   -4.04%  (p=0.008 n=5+5)
      QueryUnescape/#04-4    3.27µs ± 2%    3.34µs ± 8%     ~     (p=0.690 n=5+5)
      PathUnescape/#00-4      112ns ± 2%      99ns ± 3%  -11.25%  (p=0.008 n=5+5)
      PathUnescape/#01-4      392ns ± 2%     374ns ± 6%     ~     (p=0.063 n=5+5)
      PathUnescape/#02-4      296ns ± 2%     274ns ± 2%   -7.43%  (p=0.008 n=5+5)
      PathUnescape/#03-4      556ns ± 2%     537ns ± 1%   -3.45%  (p=0.008 n=5+5)
      PathUnescape/#04-4     2.99µs ± 1%    3.00µs ± 1%     ~     (p=0.690 n=5+5)
      
      name                 old allocs/op  new allocs/op  delta
      QueryUnescape/#00-4      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.008 n=5+5)
      QueryUnescape/#01-4      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.008 n=5+5)
      QueryUnescape/#02-4      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.008 n=5+5)
      QueryUnescape/#03-4      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.008 n=5+5)
      QueryUnescape/#04-4      2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.008 n=5+5)
      PathUnescape/#00-4       2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.008 n=5+5)
      PathUnescape/#01-4       2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.008 n=5+5)
      PathUnescape/#02-4       2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.008 n=5+5)
      PathUnescape/#03-4       2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.008 n=5+5)
      PathUnescape/#04-4       2.00 ± 0%      1.00 ± 0%  -50.00%  (p=0.008 n=5+5)
      
      Change-Id: I7cba5eb53bebef7b1fdd44598eed47241ce83167
      Reviewed-on: https://go-review.googlesource.com/c/go/+/166463Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      601eee39
    • Matthew Dempsky's avatar
      cmd/compile: don't call hcrash in Warn · 24513d33
      Matthew Dempsky authored
      Fixes #31638.
      
      Change-Id: I748f64b48b75241a9db31c9f37555379a841677a
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173443
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      24513d33
    • Brad Fitzpatrick's avatar
      net: don't crash on Windows when Lookup name has null byte in string · 2e118812
      Brad Fitzpatrick authored
      Fixes #31597
      
      Change-Id: I0db1f6f457632c49f9ecfa9d85b99b4cf7d91325
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173362
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      Reviewed-by: default avatarAlex Brainman <alex.brainman@gmail.com>
      2e118812
    • Keith Randall's avatar
      Revert "cmd/compile: add signed divisibility by power of 2 rules" · 17615969
      Keith Randall authored
      This reverts CL 168038 (git 68819fb6)
      
      Reason for revert: Doesn't work on 32 bit archs.
      
      Change-Id: Idec9098060dc65bc2f774c5383f0477f8eb63a3d
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173442Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      17615969
    • Bryan C. Mills's avatar
      cmd/go/internal/web: merge internal/web2 into web · 58de7c6d
      Bryan C. Mills authored
      The cmd/go/internal/web package was forked in order to support direct
      HTTPS fetches from widely-used hosting providers,¹ but direct fetches
      were subsequently dropped in CL 107657. The forked web2 package, with
      its GitHub-specific diagnostics and .netrc support, remained in use
      for module proxy support, but was not used for the initial '?go-get=1'
      path resolution, so the .netrc file was only used to fetch from
      already-resolved module protocol servers.
      
      This CL moves the .netrc support into its own (new) package,
      cmd/go/internal/auth, and consolidates the web and web2 packages back
      into just web. As a result, fetches via the web package now support
      .netrc, and fetches that previously used web2 now enforce the same
      security policies as web (such as prohibiting HTTPS-to-HTTP
      redirects).
      
      ¹https://github.com/golang/vgo/commit/63138cb6ceed7d6d4e51a8cbd568c64bd3e2b132
      
      Fixes #29591
      Fixes #29888
      Fixes #30610
      Updates #26232
      
      Change-Id: Ia3a13526e443679cf14a72a1f3db96f336ce5e73
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170879
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      Reviewed-by: default avatarJay Conrod <jayconrod@google.com>
      58de7c6d
    • David Chase's avatar
      cmd/link: revert/revise CL 98075 because LLDB is very picky now · 807761f3
      David Chase authored
      This was originally
      
      Revert "cmd/link: fix up debug_range for dsymutil (revert CL 72371)"
      
      which has the effect of no longer using Base Address Selection
      Entries in DWARF.  However, the build-time costs of that are
      about 2%, so instead the hacky fixup that generated technically
      incorrect DWARF was removed from the linker, and the choice
      is instead made in the compiler, dependent on platform, but
      also under control of a flag so that we can report this bug
      against LLDB/dsymutil/dwarfdump (really, the LLVM dwarf
      libraries).
      
      This however does not solve #31188; debugging still fails,
      but dwarfdump no longer complains.  There are at least two
      LLDB bugs involved, and this change will at allow us
      to report them without them being rejected because our
      now-obsolete workaround for the first bug creates
      not-quite-DWARF.
      
      Updates #31188.
      
      Change-Id: I5300c51ad202147bab7333329ebe961623d2b47d
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170638
      Run-TryBot: David Chase <drchase@google.com>
      Reviewed-by: default avatarHeschi Kreinick <heschi@google.com>
      807761f3
    • Brian Kessler's avatar
      cmd/compile: add signed divisibility by power of 2 rules · 68819fb6
      Brian Kessler authored
      For powers of two (c=1<<k), the divisibility check x%c == 0 can be made
      just by checking the trailing zeroes via a mask x&(c-1)==0 even for signed
      integers.  This avoids division fixups when just divisibility check is needed.
      
      To apply this rule the generic divisibility rule for  A%B = A-(A/B*B) is disabled
      on the "opt" pass, but this does not affect generated code as this rule is applied
      later.
      
      The speed up on amd64 due to elimination of unneccessary fixup code is ~55%:
      
      name                     old time/op  new time/op  delta
      DivconstI64-4            2.08ns ± 0%  2.07ns ± 0%     ~     (p=0.079 n=5+5)
      DivisiblePow2constI64-4  1.78ns ± 1%  0.81ns ± 1%  -54.55%  (p=0.008 n=5+5)
      DivconstU64-4            2.08ns ± 0%  2.08ns ± 0%     ~     (p=1.000 n=5+5)
      DivconstI32-4            1.53ns ± 0%  1.53ns ± 0%     ~     (all equal)
      DivisiblePow2constI32-4  1.79ns ± 1%  0.81ns ± 4%  -54.75%  (p=0.008 n=5+5)
      DivconstU32-4            1.78ns ± 1%  1.78ns ± 1%     ~     (p=1.000 n=5+5)
      DivconstI16-4            1.54ns ± 2%  1.53ns ± 0%     ~     (p=0.333 n=5+4)
      DivisiblePow2constI16-4  1.78ns ± 0%  0.79ns ± 1%  -55.39%  (p=0.000 n=4+5)
      DivconstU16-4            1.00ns ± 5%  0.99ns ± 1%     ~     (p=0.730 n=5+5)
      DivconstI8-4             1.54ns ± 0%  1.53ns ± 0%     ~     (p=0.714 n=4+5)
      DivisiblePow2constI8-4   1.78ns ± 0%  0.80ns ± 0%  -55.06%  (p=0.000 n=5+4)
      DivconstU8-4             0.93ns ± 1%  0.95ns ± 1%   +1.72%  (p=0.024 n=5+5)
      
      A follow-up CL will address the general case of x%c == 0 for signed integers.
      
      Updates #15806
      
      Change-Id: I0d284863774b1bc8c4ce87443bbaec6103e14ef4
      Reviewed-on: https://go-review.googlesource.com/c/go/+/168038Reviewed-by: default avatarKeith Randall <khr@golang.org>
      68819fb6
    • Keith Randall's avatar
      runtime: randomize package initialization order in race mode · 8515d9cf
      Keith Randall authored
      This is one small step to force people to not depend on the order of
      initialization of packages which are not explicitly ordered by import
      directives. Similar to randomizing map iteration order, this makes
      sure people aren't depending on the behavior of the current release,
      so that we can change the order in future releases without breaking
      everyone.
      
      Maybe one day we can randomize always, but for now we do it just in
      race mode. (We would need to measure the impact on startup time before
      we enabled it always.)
      
      RELNOTE=yes
      
      Change-Id: I99026394796125974c5f2c3660a88becb92c9df3
      Reviewed-on: https://go-review.googlesource.com/c/go/+/170318
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      8515d9cf
    • Keith Randall's avatar
      cmd/compile: always mark atColumn1 results as statements · fd788a86
      Keith Randall authored
      In 31618, we end up comparing the is-stmt-ness of positions
      to repurpose real instructions as inline marks. If the is-stmt-ness
      doesn't match, we end up not being able to remove the inline mark.
      
      Always use statement-full positions to do the matching, so we
      always find a match if there is one.
      
      Also always use positions that are statements for inline marks.
      
      Fixes #31618
      
      Change-Id: Idaf39bdb32fa45238d5cd52973cadf4504f947d5
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173324
      Run-TryBot: Keith Randall <khr@golang.org>
      Reviewed-by: default avatarDavid Chase <drchase@google.com>
      fd788a86
    • Matthew Dempsky's avatar
      cmd/compile: respect -newescape in genwrapper · a152dd04
      Matthew Dempsky authored
      Noticed while preparing a CL for Go 1.14 to remove esc.go.
      
      Change-Id: Ic12be33f5b16c8424d85f373fa450247be086078
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173298
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarCherry Zhang <cherryyz@google.com>
      a152dd04
    • Michael Munday's avatar
      math: consolidate assembly stub implementations · f0fdbb1e
      Michael Munday authored
      Where assembly functions are just jumps to the Go implementation
      put them into a stubs_<arch>.s file. This reduces the number of
      files considerably and makes it easier to see what is really
      implemented in assembly.
      
      I've also run the stubs files through asmfmt to format them in
      a more consistent way.
      
      Eventually we should replace these 'stub' assembly files with
      a pure Go implementation now that we have mid-stack inlining
      (see #31362).
      
      Change-Id: If5b2022dcc23e1299f1b7ba79884f1b1263d0f7f
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173398
      Run-TryBot: Michael Munday <mike.munday@ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      f0fdbb1e
    • Benny Siegert's avatar
      A: Add Maya Rashish (individual CLA) · 3d631662
      Benny Siegert authored
      Change-Id: I1380229c250a6100dc7e0bcf59be8df425a3efac
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173399Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      3d631662
    • Benny Siegert's avatar
      doc: update wording in contribution guide · d0fadb93
      Benny Siegert authored
      The top right menu in Gerrit is now a gear icon, and the link
      has a slightly different title.
      
      Change-Id: I3f5d194f31ad09a99416a45db392aa4b5c7d98ff
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173400Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      d0fadb93
    • Nikhil Benesch's avatar
      cmd/go: include AR env var in gccgo build IDs · 213d1cf3
      Nikhil Benesch authored
      The gccgo toolchain uses the archiver specified by the AR environment
      variable, or `ar` by default. Teach the build ID to take the value of
      this environment variable into account, since different archivers can
      produce different results.
      
      Fix #30046.
      
      Change-Id: Ia6821258d54eecedb9026afc38a515cd564c45cb
      Reviewed-on: https://go-review.googlesource.com/c/go/+/160897
      Run-TryBot: Russ Cox <rsc@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      213d1cf3
    • Russ Cox's avatar
      encoding/json: document HTML escaping in Compact · d92bc7a5
      Russ Cox authored
      Make explicit that Compact does HTML escaping.
      
      Fixes #30357.
      
      Change-Id: I4648f8f3e907d659db977d07253f716df6e07d7b
      Reviewed-on: https://go-review.googlesource.com/c/go/+/173417
      Run-TryBot: Russ Cox <rsc@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      d92bc7a5