1. 06 Nov, 2018 8 commits
    • Alan Donovan's avatar
      cmd/vendor: add x/tools/go/analysis/cmd/vet-lite + deps · 8b469209
      Alan Donovan authored
      This change adds the vet-lite command (the future cmd/vet) and all its
      dependencies from x/tools, but not its tests and their dependencies.
      It was created with these commands:
      
        $ (cd $GOPATH/src/golang.org/x/tools && git checkout c76e1ad)
        $ cd GOROOT/src/cmd
        $ govendor add $(go list -deps golang.org/x/tools/go/analysis/cmd/vet-lite | grep golang.org/x/tools)
        $ rm -fr $(find vendor/golang.org/x/tools/ -name testdata)
        $ rm $(find vendor/golang.org/x/tools/ -name \*_test.go)
      
      I feel sure I am holding govendor wrong. Please advise.
      
      A followup CL will make cmd/vet behave like vet-lite, initially just
      for users that opt in, and soon after for all users, at which point
      cmd/vet will be replaced in its entirety by a copy of vet-lite's small
      main.go.
      
      In the meantime, anyone can try the new tool using these commands:
      
       $ go build cmd/vendor/golang.org/x/tools/go/analysis/cmd/vet-lite
       $ export GOVETTOOL=$(which vet-lite)
       $ go vet your/project/...
      
      Change-Id: Iea168111a32ce62f82f9fb706385ca0f368bc869
      Reviewed-on: https://go-review.googlesource.com/c/147444Reviewed-by: default avatarRuss Cox <rsc@golang.org>
      8b469209
    • Lynn Boger's avatar
      runtime: improve performance of memclr, memmove on ppc64x · aa9bcea3
      Lynn Boger authored
      This improves the asm implementations for memmove and memclr on
      ppc64x through use of vsx loads and stores when size is >= 32 bytes.
      For memclr, dcbz is used when the size is >= 512 and aligned to 128.
      
      Memclr/64       13.3ns ± 0%     10.7ns ± 0%   -19.55%  (p=0.000 n=8+7)
      Memclr/96       14.9ns ± 0%     11.4ns ± 0%   -23.49%  (p=0.000 n=8+8)
      Memclr/128      16.3ns ± 0%     12.3ns ± 0%   -24.54%  (p=0.000 n=8+8)
      Memclr/160      17.3ns ± 0%     13.0ns ± 0%   -24.86%  (p=0.000 n=8+8)
      Memclr/256      20.0ns ± 0%     15.3ns ± 0%   -23.62%  (p=0.000 n=8+8)
      Memclr/512      34.2ns ± 0%     10.2ns ± 0%   -70.20%  (p=0.000 n=8+8)
      Memclr/4096      178ns ± 0%       23ns ± 0%   -87.13%  (p=0.000 n=8+8)
      Memclr/65536    2.67µs ± 0%     0.30µs ± 0%   -88.89%  (p=0.000 n=7+8)
      Memclr/1M       43.2µs ± 0%     10.0µs ± 0%   -76.85%  (p=0.000 n=8+8)
      Memclr/4M        173µs ± 0%       40µs ± 0%   -76.88%  (p=0.000 n=8+8)
      Memclr/8M        349µs ± 0%       82µs ± 0%   -76.58%  (p=0.000 n=8+8)
      Memclr/16M       701µs ± 7%      672µs ± 0%    -4.05%  (p=0.040 n=8+7)
      Memclr/64M      2.70ms ± 0%     2.67ms ± 0%    -0.96%  (p=0.000 n=8+7)
      
      Memmove/32      6.59ns ± 0%    5.84ns ± 0%  -11.34%  (p=0.029 n=4+4)
      Memmove/64      7.91ns ± 0%    6.97ns ± 0%  -11.92%  (p=0.029 n=4+4)
      Memmove/128     10.5ns ± 0%     8.8ns ± 0%  -16.24%  (p=0.029 n=4+4)
      Memmove/256     21.0ns ± 0%    12.9ns ± 0%  -38.57%  (p=0.029 n=4+4)
      Memmove/512     28.4ns ± 0%    26.2ns ± 0%   -7.75%  (p=0.029 n=4+4)
      Memmove/1024    48.2ns ± 1%    39.4ns ± 0%  -18.26%  (p=0.029 n=4+4)
      Memmove/2048    85.4ns ± 0%    69.0ns ± 0%  -19.20%  (p=0.029 n=4+4)
      Memmove/4096     159ns ± 0%     128ns ± 0%  -19.50%  (p=0.029 n=4+4)
      
      Change-Id: I8c1adf88790845bf31444a15249456006eb5bf8b
      Reviewed-on: https://go-review.googlesource.com/c/141217
      Run-TryBot: Lynn Boger <laboger@linux.vnet.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarMichael Munday <mike.munday@ibm.com>
      aa9bcea3
    • Clément Chigot's avatar
      cmd/compile/internal/gc: update cgo_import_dynamic for AIX · e1978a2d
      Clément Chigot authored
      On AIX, cmd/link needs two information in order to generate a dynamic
      import, the library and its object needed. Currently, cmd/link isn't
      able to retrieve this object only with the name of the library.
      Therefore, the library pattern in cgo_import_dynamic must be
      "lib.a/obj.o".
      
      Change-Id: Ib8b8aaa9807c9fa6af46ece4e312d58073ed6ec1
      Reviewed-on: https://go-review.googlesource.com/c/146957
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      e1978a2d
    • Raghavendra Nagaraj's avatar
      reflect: fix StructOf panics from too many methods in embedded fields · 0e4a0b93
      Raghavendra Nagaraj authored
      Previously we panicked if the number of methods present for an embedded
      field was >= 32. This change removes that limit and now StructOf
      dynamically calls itself to create space for the number of methods.
      
      Fixes #25402
      
      Change-Id: I3b1deb119796d25f7e6eee1cdb126327b49a0b5e
      GitHub-Last-Rev: 16da71ad6b23563f3ed26f1914adf41e3d42de69
      GitHub-Pull-Request: golang/go#26865
      Reviewed-on: https://go-review.googlesource.com/c/128479
      Run-TryBot: Ian Lance Taylor <iant@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      0e4a0b93
    • Mikio Hara's avatar
      net/http: update bundled SOCKS client · 510eea2d
      Mikio Hara authored
      Updates socks_bundle.go to git rev 26e67e7 for:
      - 26e67e7 internal/socks: fix socket descriptor leakage in Dialer.Dial
      
      Change-Id: I9ab27a85504d77f1ca2e97cb005f5e37fd3c3ff4
      Reviewed-on: https://go-review.googlesource.com/c/147717
      Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      510eea2d
    • Josh Bleecher Snyder's avatar
      cmd/compile: loop in disjoint OpOffPtr check · c1a16b7d
      Josh Bleecher Snyder authored
      We collapse OpOffPtrs during generic rewrites.
      However, we also use disjoint at the same time.
      Instead of waiting for all OpOffPtrs to be collapsed
      before the disjointness rules can kick in,
      burrow through all OpOffPtrs immediately.
      
      Change-Id: I60d0a70a9b4605b1817db7c4aab0c0d789651c90
      Reviewed-on: https://go-review.googlesource.com/c/145206
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: default avatarMichael Munday <mike.munday@ibm.com>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      c1a16b7d
    • Michael Stapelberg's avatar
      net: update zoneCache on cache misses to cover appearing interfaces · 9fc22d29
      Michael Stapelberg authored
      performance differences are in measurement noise as per benchcmp:
      
      benchmark                            old ns/op     new ns/op     delta
      BenchmarkUDP6LinkLocalUnicast-12     5012          5009          -0.06%
      
      Fixes #28535
      
      Change-Id: Id022e2ed089ce8388a2398e755848ec94e77e653
      Reviewed-on: https://go-review.googlesource.com/c/146941
      Run-TryBot: Mikio Hara <mikioh.public.networking@gmail.com>
      Reviewed-by: default avatarMikio Hara <mikioh.public.networking@gmail.com>
      9fc22d29
    • Josh Bleecher Snyder's avatar
      cmd/compile: shrink specialized convT2x call sites · 5848b6c9
      Josh Bleecher Snyder authored
      convT2E16 and other specialized type-to-interface routines
      accept a type/itab argument and return a complete interface value.
      However, we know enough in the routine to do without the type.
      And the caller can construct the interface value using the type.
      
      Doing so shrinks the call sites of ten of the specialized convT2x routines.
      It also lets us unify the empty and non-empty interface routines.
      
      Cuts 12k off cmd/go.
      
      name                         old time/op  new time/op  delta
      ConvT2ESmall-8               2.96ns ± 2%  2.34ns ± 4%  -21.01%  (p=0.000 n=175+189)
      ConvT2EUintptr-8             3.00ns ± 3%  2.34ns ± 4%  -22.02%  (p=0.000 n=189+187)
      ConvT2ELarge-8               21.3ns ± 7%  21.5ns ± 5%   +1.02%  (p=0.000 n=200+197)
      ConvT2ISmall-8               2.99ns ± 4%  2.33ns ± 3%  -21.95%  (p=0.000 n=193+184)
      ConvT2IUintptr-8             3.02ns ± 3%  2.33ns ± 3%  -22.82%  (p=0.000 n=198+190)
      ConvT2ILarge-8               21.7ns ± 5%  22.2ns ± 4%   +2.31%  (p=0.000 n=199+198)
      ConvT2Ezero/zero/16-8        2.96ns ± 2%  2.33ns ± 3%  -21.11%  (p=0.000 n=174+187)
      ConvT2Ezero/zero/32-8        2.96ns ± 1%  2.35ns ± 4%  -20.62%  (p=0.000 n=163+193)
      ConvT2Ezero/zero/64-8        2.99ns ± 2%  2.34ns ± 4%  -21.78%  (p=0.000 n=183+188)
      ConvT2Ezero/zero/str-8       3.27ns ± 3%  2.54ns ± 3%  -22.32%  (p=0.000 n=195+192)
      ConvT2Ezero/zero/slice-8     3.46ns ± 4%  2.81ns ± 3%  -18.96%  (p=0.000 n=197+164)
      ConvT2Ezero/zero/big-8       88.4ns ±20%  90.0ns ±20%   +1.84%  (p=0.000 n=196+198)
      ConvT2Ezero/nonzero/16-8     12.6ns ± 3%  12.3ns ± 3%   -2.34%  (p=0.000 n=167+196)
      ConvT2Ezero/nonzero/32-8     12.3ns ± 4%  11.9ns ± 3%   -2.95%  (p=0.000 n=187+193)
      ConvT2Ezero/nonzero/64-8     14.2ns ± 6%  13.8ns ± 5%   -2.94%  (p=0.000 n=198+199)
      ConvT2Ezero/nonzero/str-8    27.2ns ± 5%  26.8ns ± 5%   -1.33%  (p=0.000 n=200+198)
      ConvT2Ezero/nonzero/slice-8  33.3ns ± 8%  33.1ns ± 6%   -0.82%  (p=0.000 n=199+200)
      ConvT2Ezero/nonzero/big-8    88.8ns ±22%  90.2ns ±18%   +1.58%  (p=0.000 n=200+199)
      
      
      Neligible toolspeed impact.
      
      name        old alloc/op      new alloc/op      delta
      Template         35.4MB ± 0%       35.3MB ± 0%  -0.06%  (p=0.008 n=5+5)
      Unicode          29.1MB ± 0%       29.1MB ± 0%    ~     (p=0.310 n=5+5)
      GoTypes           122MB ± 0%        122MB ± 0%  -0.08%  (p=0.008 n=5+5)
      Compiler          514MB ± 0%        513MB ± 0%  -0.02%  (p=0.008 n=5+5)
      SSA              1.94GB ± 0%       1.94GB ± 0%  -0.01%  (p=0.008 n=5+5)
      Flate            24.2MB ± 0%       24.2MB ± 0%    ~     (p=0.548 n=5+5)
      GoParser         28.5MB ± 0%       28.5MB ± 0%  -0.05%  (p=0.016 n=5+5)
      Reflect          86.3MB ± 0%       86.2MB ± 0%  -0.02%  (p=0.008 n=5+5)
      Tar              34.9MB ± 0%       34.9MB ± 0%    ~     (p=0.095 n=5+5)
      XML              47.1MB ± 0%       47.1MB ± 0%  -0.05%  (p=0.008 n=5+5)
      [Geo mean]       81.0MB            81.0MB       -0.03%
      
      name        old allocs/op     new allocs/op     delta
      Template           349k ± 0%         349k ± 0%  -0.08%  (p=0.008 n=5+5)
      Unicode            340k ± 0%         340k ± 0%    ~     (p=0.111 n=5+5)
      GoTypes           1.28M ± 0%        1.28M ± 0%  -0.09%  (p=0.008 n=5+5)
      Compiler          4.92M ± 0%        4.92M ± 0%  -0.08%  (p=0.008 n=5+5)
      SSA               15.3M ± 0%        15.3M ± 0%  -0.03%  (p=0.008 n=5+5)
      Flate              233k ± 0%         233k ± 0%    ~     (p=0.500 n=5+5)
      GoParser           292k ± 0%         292k ± 0%  -0.06%  (p=0.008 n=5+5)
      Reflect           1.05M ± 0%        1.05M ± 0%  -0.02%  (p=0.008 n=5+5)
      Tar                344k ± 0%         343k ± 0%  -0.06%  (p=0.008 n=5+5)
      XML                430k ± 0%         429k ± 0%  -0.08%  (p=0.008 n=5+5)
      [Geo mean]         809k              809k       -0.05%
      
      name        old object-bytes  new object-bytes  delta
      Template          507kB ± 0%        507kB ± 0%  -0.04%  (p=0.008 n=5+5)
      Unicode           225kB ± 0%        225kB ± 0%    ~     (all equal)
      GoTypes          1.85MB ± 0%       1.85MB ± 0%  -0.08%  (p=0.008 n=5+5)
      Compiler         6.75MB ± 0%       6.75MB ± 0%  +0.01%  (p=0.008 n=5+5)
      SSA              21.4MB ± 0%       21.4MB ± 0%  -0.02%  (p=0.008 n=5+5)
      Flate             328kB ± 0%        328kB ± 0%  -0.03%  (p=0.008 n=5+5)
      GoParser          403kB ± 0%        402kB ± 0%  -0.06%  (p=0.008 n=5+5)
      Reflect          1.41MB ± 0%       1.41MB ± 0%  -0.03%  (p=0.008 n=5+5)
      Tar               457kB ± 0%        457kB ± 0%  -0.05%  (p=0.008 n=5+5)
      XML               601kB ± 0%        600kB ± 0%  -0.16%  (p=0.008 n=5+5)
      [Geo mean]       1.05MB            1.04MB       -0.05%
      
      
      Change-Id: I677a4108c0ecd32617549294036aa84f9214c4fe
      Reviewed-on: https://go-review.googlesource.com/c/147360
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarKeith Randall <khr@golang.org>
      Reviewed-by: default avatarMartin Möhrmann <moehrmann@google.com>
      5848b6c9
  2. 05 Nov, 2018 21 commits
  3. 04 Nov, 2018 2 commits
  4. 03 Nov, 2018 6 commits
  5. 02 Nov, 2018 3 commits
    • Carl Mastrangelo's avatar
      net/http: speed up ServeMux matching · 1645dfa2
      Carl Mastrangelo authored
      Scanning through all path patterns is not necessary, since the
      paths do not change frequently.  Instead, maintain a sorted list
      of path prefixes and return the first match.
      
      name            old time/op  new time/op  delta
      ServerMatch-12   134ns ± 3%    17ns ± 4%  -86.95%  (p=0.000 n=19+20)
      
      Change-Id: I15b4483dc30db413321435ee6815fc9bf2bcc546
      Reviewed-on: https://go-review.googlesource.com/c/144937Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      1645dfa2
    • Brad Fitzpatrick's avatar
      all: use "reports whether" consistently in the few places that didn't · 3813edf2
      Brad Fitzpatrick authored
      Go documentation style for boolean funcs is to say:
      
          // Foo reports whether ...
          func Foo() bool
      
      (rather than "returns true if")
      
      This CL also replaces 4 uses of "iff" with the same "reports whether"
      wording, which doesn't lose any meaning, and will prevent people from
      sending typo fixes when they don't realize it's "if and only if". In
      the past I think we've had the typo CLs updated to just say "reports
      whether". So do them all at once.
      
      (Inspired by the addition of another "returns true if" in CL 146938
      in fd_plan9.go)
      
      Created with:
      
      $ perl -i -npe 's/returns true if/reports whether/' $(git grep -l "returns true iff" | grep -v vendor)
      $ perl -i -npe 's/returns true if/reports whether/' $(git grep -l "returns true if" | grep -v vendor)
      
      Change-Id: Ided502237f5ab0d25cb625dbab12529c361a8b9f
      Reviewed-on: https://go-review.googlesource.com/c/147037Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      3813edf2
    • Robert Griesemer's avatar
      cmd/compile/internal/gc: add tracing support to debug type checking · e25823ed
      Robert Griesemer authored
      The compiler must first be built with the constant enableTrace set
      to true (typecheck.go). After that, the -t flag becomes available
      which enables tracing output of type-checking functions.
      
      With enableTrace == false, the tracing code becomes dead code
      and won't affect the compiler.
      
      Typical output might look like this:
      
      path/y.go:4:6: typecheck 0xc00033e180 DCLTYPE <node DCLTYPE> tc=0
      path/y.go:4:6: . typecheck1 0xc00033e180 DCLTYPE <node DCLTYPE> tc=2
      path/y.go:4:6: . . typecheck 0xc000331a40 TYPE T tc=1
      path/y.go:4:6: . . . typecheck1 0xc000331a40 TYPE T tc=2
      path/y.go:4:6: . . . . typecheckdef 0xc000331a40 TYPE T tc=2
      path/y.go:4:6: . . . . => 0xc000331a40 TYPE T tc=2 type=*T
      path/y.go:4:6: . . . => 0xc000331a40 TYPE T tc=2 type=*T
      path/y.go:4:6: . . => 0xc000331a40 TYPE T tc=1 type=*T
      path/y.go:4:6: . => 0xc00033e180 DCLTYPE <node DCLTYPE> tc=2 type=<T>
      path/y.go:4:6: => 0xc00033e180 DCLTYPE <node DCLTYPE> tc=1 type=<T>
      
      Disabled by default.
      
      Change-Id: Ifd8385290d1cf0d3fc5e8468b2f4ab84e8eff338
      Reviewed-on: https://go-review.googlesource.com/c/146782Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      e25823ed