1. 06 Nov, 2018 6 commits
    • 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 5 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
    • Filippo Valsorda's avatar
      crypto/tls: implement TLS 1.3 server handshake (base) · c21ba09b
      Filippo Valsorda authored
      Implement a basic TLS 1.3 server handshake, only enabled if explicitly
      requested with MaxVersion.
      
      This CL intentionally leaves for future CLs:
        - PSK modes and resumption
        - client authentication
        - compatibility mode ChangeCipherSpecs
        - early data skipping
        - post-handshake messages
        - downgrade protection
        - KeyLogWriter support
        - TLS_FALLBACK_SCSV processing
      
      It also leaves a few areas up for a wider refactor (maybe in Go 1.13):
        - the certificate selection logic can be significantly improved,
          including supporting and surfacing signature_algorithms_cert, but
          this isn't new in TLS 1.3 (see comment in processClientHello)
        - handshake_server_tls13.go can be dried up and broken into more
          meaningful, smaller functions, but it felt premature to do before
          PSK and client auth support
        - the monstrous ClientHello equality check in doHelloRetryRequest can
          get both cleaner and more complete with collaboration from the
          parsing layer, which can come at the same time as extension
          duplicates detection
      
      Updates #9671
      
      Change-Id: Id9db2b6ecc2eea21bf9b59b6d1d9c84a7435151c
      Reviewed-on: https://go-review.googlesource.com/c/147017
      Run-TryBot: Filippo Valsorda <filippo@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAdam Langley <agl@golang.org>
      c21ba09b
    • Filippo Valsorda's avatar
      crypto/tls: implement TLS 1.3 client handshake (base) · 4caa1276
      Filippo Valsorda authored
      Implement a basic TLS 1.3 client handshake, only enabled if explicitly
      requested with MaxVersion.
      
      This CL intentionally leaves for future CLs:
        - PSK modes and resumption
        - client authentication
        - post-handshake messages
        - downgrade protection
        - KeyLogWriter support
      
      Updates #9671
      
      Change-Id: Ieb6130fb6f25aea4f0d39e3a2448dfc942e1de7a
      Reviewed-on: https://go-review.googlesource.com/c/146559
      Run-TryBot: Filippo Valsorda <filippo@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarAdam Langley <agl@golang.org>
      4caa1276