1. 17 Aug, 2016 15 commits
    • Alberto Donizetti's avatar
      math/big: avoid allocation in float.{Add, Sub} when there's no aliasing · cda633b3
      Alberto Donizetti authored
      name               old time/op    new time/op    delta
      FloatAdd/10-4         116ns ± 1%      82ns ± 0%   -28.74%  (p=0.008 n=5+5)
      FloatAdd/100-4        124ns ± 0%      86ns ± 1%   -30.34%  (p=0.016 n=4+5)
      FloatAdd/1000-4       192ns ± 1%     123ns ± 0%   -35.94%  (p=0.008 n=5+5)
      FloatAdd/10000-4      826ns ± 0%     438ns ± 0%   -46.99%  (p=0.000 n=4+5)
      FloatAdd/100000-4    6.82µs ± 1%    3.36µs ± 0%   -50.74%  (p=0.008 n=5+5)
      FloatSub/10-4         108ns ± 1%      77ns ± 1%   -29.06%  (p=0.008 n=5+5)
      FloatSub/100-4        115ns ± 0%      79ns ± 0%   -31.48%  (p=0.029 n=4+4)
      FloatSub/1000-4       168ns ± 0%      99ns ± 0%   -41.09%  (p=0.029 n=4+4)
      FloatSub/10000-4      690ns ± 2%     288ns ± 1%   -58.24%  (p=0.008 n=5+5)
      FloatSub/100000-4    5.37µs ± 1%    2.10µs ± 1%   -60.89%  (p=0.008 n=5+5)
      
      name               old alloc/op   new alloc/op   delta
      FloatAdd/10-4         48.0B ± 0%     0.0B ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatAdd/100-4        64.0B ± 0%     0.0B ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatAdd/1000-4        176B ± 0%       0B ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatAdd/10000-4     1.41kB ± 0%   0.00kB ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatAdd/100000-4    13.6kB ± 0%    0.0kB ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatSub/10-4         48.0B ± 0%     0.0B ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatSub/100-4        64.0B ± 0%     0.0B ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatSub/1000-4        176B ± 0%       0B ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatSub/10000-4     1.41kB ± 0%   0.00kB ±NaN%  -100.00%  (p=0.008 n=5+5)
      FloatSub/100000-4    13.6kB ± 0%    0.0kB ±NaN%  -100.00%  (p=0.008 n=5+5)
      
      Fixes #14868
      
      Change-Id: Ia2b8b1a8ef0868288ecb25f812b17bd03ff40d1c
      Reviewed-on: https://go-review.googlesource.com/23568Reviewed-by: 's avatarRobert Griesemer <gri@golang.org>
      cda633b3
    • Robert Griesemer's avatar
      cmd/compile: add compiler phase timing · f542576b
      Robert Griesemer authored
      Timings is a simple data structure that collects times of labeled
      Start/Stop events describing timed phases, which later can be written
      to a file.
      
      Adjacent phases with common label prefix are automatically collected
      in a group together with the accumulated phase time.
      
      Timing data can be appended to a file in benchmark data format
      using the new -bench flag:
      
      $ go build -gcflags="-bench=/dev/stdout" -o /dev/null go/types
      commit: devel +8847c6b Mon Aug 15 17:51:53 2016 -0700
      goos: darwin
      goarch: amd64
      BenchmarkCompile:go/types:fe:init              1       663292 ns/op      0.07 %
      BenchmarkCompile:go/types:fe:loadsys           1      1337371 ns/op      0.14 %
      BenchmarkCompile:go/types:fe:parse             1     47008869 ns/op      4.91 %    10824 lines    230254 lines/s
      BenchmarkCompile:go/types:fe:typecheck:top1    1      2843343 ns/op      0.30 %
      BenchmarkCompile:go/types:fe:typecheck:top2    1       447457 ns/op      0.05 %
      BenchmarkCompile:go/types:fe:typecheck:func    1     15119595 ns/op      1.58 %      427 funcs     28241 funcs/s
      BenchmarkCompile:go/types:fe:capturevars       1        56314 ns/op      0.01 %
      BenchmarkCompile:go/types:fe:inlining          1      9805767 ns/op      1.02 %
      BenchmarkCompile:go/types:fe:escapes           1     53598646 ns/op      5.60 %
      BenchmarkCompile:go/types:fe:xclosures         1       199302 ns/op      0.02 %
      BenchmarkCompile:go/types:fe:subtotal          1    131079956 ns/op     13.70 %
      BenchmarkCompile:go/types:be:compilefuncs      1    692009428 ns/op     72.33 %      427 funcs       617 funcs/s
      BenchmarkCompile:go/types:be:externaldcls      1        54591 ns/op      0.01 %
      BenchmarkCompile:go/types:be:dumpobj           1    133478173 ns/op     13.95 %
      BenchmarkCompile:go/types:be:subtotal          1    825542192 ns/op     86.29 %
      BenchmarkCompile:go/types:unaccounted          1       106101 ns/op      0.01 %
      BenchmarkCompile:go/types:total                1    956728249 ns/op    100.00 %
      
      For #16169.
      
      Change-Id: I93265fe0cb08e47cd413608d0824c5dd35ba7899
      Reviewed-on: https://go-review.googlesource.com/24462Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      f542576b
    • Tom Wilkie's avatar
      net: don't avoid resolving .local addresses · 289df4e6
      Tom Wilkie authored
      .local addresses are used by things like Kubernetes and Weave DNS; Go
      should not avoid resolving them.
      
      This is a partial revert of https://golang.org/cl/21328 which was too
      strict of an interpretation of RFC 6762.
      
      Fixes #16739
      
      Change-Id: I349415b4eab5d61240dd18217bd95dc7d2105cd5
      Reviewed-on: https://go-review.googlesource.com/27250Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      289df4e6
    • Matthew Dempsky's avatar
      cmd/compile/internal/s390x: cleanup betypeinit · 73fdba26
      Matthew Dempsky authored
      The Width{int,ptr,reg} assignments are no longer necessary since
      golang.org/cl/21623. The other arch's betypeinit functions were
      cleaned up, but apparently this one was missed.
      
      Change-Id: I1c7f074d7864a561659c1f98aef604f57f285fd0
      Reviewed-on: https://go-review.googlesource.com/27272
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: 's avatarMichael Munday <munday@ca.ibm.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      73fdba26
    • Matthew Dempsky's avatar
      doc/go1.8: support "option ndots:0" in resolv.conf · e772c723
      Matthew Dempsky authored
      Updates #15419.
      
      Change-Id: If7c80adcb38b5731e337b2ae2d9d76fcf8513d8e
      Reviewed-on: https://go-review.googlesource.com/27271Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      e772c723
    • Dan Peterson's avatar
      net: use libresolv rules for ndots range and validation · 2f73fe7a
      Dan Peterson authored
      BIND libresolv allows values from 0 to 15.
      
      For invalid values and negative numbers, 0 is used.
      For numbers greater than 15, 15 is used.
      
      Fixes #15419
      
      Change-Id: I1009bc119c3e87919bcb55a80a35532e9fc3ba52
      Reviewed-on: https://go-review.googlesource.com/24901Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      2f73fe7a
    • Cherry Zhang's avatar
      test: add test for CL 26831 · 04e76f29
      Cherry Zhang authored
      Test nil check removal for access of PAUTOHEAP.
      
      Change-Id: Id739a9cda7cd3ff173bdcccfedcad93ee90711ef
      Reviewed-on: https://go-review.googlesource.com/27232
      Run-TryBot: Cherry Zhang <cherryyz@google.com>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      04e76f29
    • Florian Uekermann's avatar
      math/rand: Document origin of cooked pseudo-random numbers · 507144c0
      Florian Uekermann authored
      The Source provided by math/rand relies on an array of cooked
      pseudo-random 63bit integers for seeding. The origin of these
      numbers is undocumented.
      
      Add a standalone program in math/rand folder that generates
      the 63bit integer array as well as a 64bit version supporting
      extension of the Source to 64bit pseudo-random number
      generation while maintaining the current sequence in the
      lower 63bit.
      
      The code is largely based on the initial implementation of the
      random number generator in the go repository by Ken Thompson
      (revision 399).
      
      Change-Id: Ib4192aea8127595027116a0f5a7be53f11dc110b
      Reviewed-on: https://go-review.googlesource.com/22230Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      507144c0
    • Austin Clements's avatar
      runtime: fix check for vacuous page boundary rounding · 336dad2a
      Austin Clements authored
      sysUnused (e.g., madvise MADV_FREE) is only sensible to call on
      physical page boundaries, so scavengelist rounds in the bounds of the
      region being released to the nearest physical page boundaries.
      However, if the region is smaller than a physical page and neither the
      start nor end fall on a boundary, then rounding the start up to a page
      boundary and the end down to a page boundary will result in end < start.
      Currently, we only give up on the region if start == end, so if we
      encounter end < start, we'll call madvise with a negative length and
      the madvise will fail.
      
      Issue #16644 gives a concrete example of this:
      
          start = 0x1285ac000
          end   = 0x1285ae000 (1 8K page)
      
      This leads to the rounded values
      
          start = 0x1285b0000
          end   = 0x1285a0000
      
      which leads to len = -65536.
      
      Fix this by giving up on the region if end <= start, not just if
      end == start.
      
      Fixes #16644.
      
      Change-Id: I8300db492dbadc82ac1ad878318b36bcb7c39524
      Reviewed-on: https://go-review.googlesource.com/27230Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      336dad2a
    • Yasuhiro Matsumoto's avatar
      syscall: mksyscall_windows.go: put path separator in suffix for matching GOROOT · 5dc7525b
      Yasuhiro Matsumoto authored
      fixes #16493
      
      Change-Id: I86bec2f9bd7965449c43e94733791f7cb18c5c4c
      Reviewed-on: https://go-review.googlesource.com/25165Reviewed-by: 's avatarAlex Brainman <alex.brainman@gmail.com>
      5dc7525b
    • Dan Peterson's avatar
      net: simplify internal dtoi and xtoi funcs · 00b779ae
      Dan Peterson authored
      Callers pass strings sliced as necessary instead of giving
      an offset.
      
      Fixes #16350
      
      Change-Id: I7ba896f6ff09e0fd0094ca6c5af5d9a81622f15e
      Reviewed-on: https://go-review.googlesource.com/27206
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      00b779ae
    • Joe Tsai's avatar
      go/build: introduce go1.8 build tag · 9c13eb37
      Joe Tsai authored
      Change-Id: Ib8855f8125970fc7ffb271635c28d31d310fcb5b
      Reviewed-on: https://go-review.googlesource.com/27192
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      Reviewed-by: 's avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      9c13eb37
    • Josh Bleecher Snyder's avatar
      cmd/compile: handle e == T comparison more efficiently · 1a7fc7b3
      Josh Bleecher Snyder authored
      Instead of making a runtime call, compare types and values.
      
      Change-Id: Id302083d5a6a5f18e04f36f304f3d290c46976ad
      Reviewed-on: https://go-review.googlesource.com/26660
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      1a7fc7b3
    • Josh Bleecher Snyder's avatar
      cmd/compile: inline x, ok := y.(T) where T is a scalar · 615a52b9
      Josh Bleecher Snyder authored
      When T is a scalar, there are no runtime calls
      required, which makes this a clear win.
      
      encoding/binary:
      WriteInts-8                958ns ± 3%     864ns ± 2%   -9.80%  (p=0.000 n=15+15)
      
      This also considerably shrinks a core fmt
      routine:
      
      Before: "".(*pp).printArg t=1 size=3952 args=0x20 locals=0xf0
      After:  "".(*pp).printArg t=1 size=2624 args=0x20 locals=0x98
      
      Unfortunately, I find it very hard to get stable
      numbers out of the fmt benchmarks due to thermal scaling.
      
      Change-Id: I1278006b030253bf8e48dc7631d18985cdaa143d
      Reviewed-on: https://go-review.googlesource.com/26659
      Run-TryBot: Josh Bleecher Snyder <josharian@gmail.com>
      Reviewed-by: 's avatarKeith Randall <khr@golang.org>
      615a52b9
    • Robert Griesemer's avatar
      cmd/compile: remove conditional code dealing with two export formats · 074d6a64
      Robert Griesemer authored
      This removes some scaffolding introduced pre-1.7, introduced to
      fix an export format bug, and to minimize conflicts with older
      formats. The currently deployed and recognized format is "v1",
      so don't worry about other versions. This is a step towards a
      better scheme for internal export format versioning.
      
      For #16244.
      
      Change-Id: Ic7cf99dd2a24ad5484cc54aed44fa09332c2cf72
      Reviewed-on: https://go-review.googlesource.com/27205Reviewed-by: 's avatarMatthew Dempsky <mdempsky@google.com>
      Run-TryBot: Robert Griesemer <gri@golang.org>
      074d6a64
  2. 16 Aug, 2016 25 commits