1. 10 Apr, 2016 6 commits
    • Klaus Post's avatar
      compress/flate: eliminate most common bounds checks · f20b1809
      Klaus Post authored
      This uses the SSA compiler to eliminate various unneeded bounds
      checks in loops and various lookups.
      
      This fixes the low hanging fruit, without any major code changes.
      
      name                       old time/op    new time/op    delta
      EncodeDigitsHuffman1e4-8     49.9µs ± 1%    48.1µs ± 1%  -3.74%   (p=0.000 n=10+9)
      EncodeDigitsHuffman1e5-8      476µs ± 1%     458µs ± 1%  -3.58%  (p=0.000 n=10+10)
      EncodeDigitsHuffman1e6-8     4.80ms ± 2%    4.56ms ± 1%  -5.07%   (p=0.000 n=10+9)
      EncodeDigitsSpeed1e4-8        305µs ± 3%     290µs ± 2%  -5.03%   (p=0.000 n=10+9)
      EncodeDigitsSpeed1e5-8       3.67ms ± 2%    3.49ms ± 2%  -4.78%   (p=0.000 n=9+10)
      EncodeDigitsSpeed1e6-8       38.3ms ± 2%    35.8ms ± 1%  -6.58%   (p=0.000 n=9+10)
      EncodeDigitsDefault1e4-8      361µs ± 2%     346µs ± 3%  -4.12%   (p=0.000 n=10+9)
      EncodeDigitsDefault1e5-8     5.24ms ± 2%    4.96ms ± 3%  -5.38%  (p=0.000 n=10+10)
      EncodeDigitsDefault1e6-8     56.5ms ± 3%    52.2ms ± 2%  -7.68%  (p=0.000 n=10+10)
      EncodeDigitsCompress1e4-8     362µs ± 2%     343µs ± 1%  -5.20%   (p=0.000 n=10+9)
      EncodeDigitsCompress1e5-8    5.26ms ± 3%    4.98ms ± 2%  -5.48%  (p=0.000 n=10+10)
      EncodeDigitsCompress1e6-8    56.0ms ± 4%    52.1ms ± 1%  -7.01%  (p=0.000 n=10+10)
      EncodeTwainHuffman1e4-8      70.9µs ± 3%    64.7µs ± 1%  -8.68%   (p=0.000 n=10+9)
      EncodeTwainHuffman1e5-8       556µs ± 2%     524µs ± 2%  -5.84%  (p=0.000 n=10+10)
      EncodeTwainHuffman1e6-8      5.54ms ± 3%    5.22ms ± 2%  -5.70%  (p=0.000 n=10+10)
      EncodeTwainSpeed1e4-8         294µs ± 3%     284µs ± 1%  -3.71%  (p=0.000 n=10+10)
      EncodeTwainSpeed1e5-8        2.59ms ± 2%    2.48ms ± 1%  -4.14%   (p=0.000 n=10+9)
      EncodeTwainSpeed1e6-8        25.6ms ± 1%    24.3ms ± 1%  -5.28%   (p=0.000 n=9+10)
      EncodeTwainDefault1e4-8       419µs ± 2%     396µs ± 1%  -5.59%   (p=0.000 n=10+9)
      EncodeTwainDefault1e5-8      6.23ms ± 4%    5.75ms ± 1%  -7.83%   (p=0.000 n=10+9)
      EncodeTwainDefault1e6-8      66.2ms ± 2%    61.4ms ± 1%  -7.22%  (p=0.000 n=10+10)
      EncodeTwainCompress1e4-8      426µs ± 1%     405µs ± 1%  -4.97%   (p=0.000 n=9+10)
      EncodeTwainCompress1e5-8     6.80ms ± 1%    6.32ms ± 1%  -6.97%   (p=0.000 n=9+10)
      EncodeTwainCompress1e6-8     74.6ms ± 3%    68.7ms ± 1%  -7.90%   (p=0.000 n=10+9)
      
      name                       old speed      new speed      delta
      EncodeDigitsHuffman1e4-8    200MB/s ± 1%   208MB/s ± 1%  +3.88%   (p=0.000 n=10+9)
      EncodeDigitsHuffman1e5-8    210MB/s ± 1%   218MB/s ± 1%  +3.71%  (p=0.000 n=10+10)
      EncodeDigitsHuffman1e6-8    208MB/s ± 2%   219MB/s ± 1%  +5.32%   (p=0.000 n=10+9)
      EncodeDigitsSpeed1e4-8     32.8MB/s ± 3%  34.5MB/s ± 2%  +5.29%   (p=0.000 n=10+9)
      EncodeDigitsSpeed1e5-8     27.2MB/s ± 2%  28.6MB/s ± 2%  +5.29%  (p=0.000 n=10+10)
      EncodeDigitsSpeed1e6-8     26.1MB/s ± 2%  27.9MB/s ± 1%  +7.02%   (p=0.000 n=9+10)
      EncodeDigitsDefault1e4-8   27.7MB/s ± 2%  28.9MB/s ± 3%  +4.30%   (p=0.000 n=10+9)
      EncodeDigitsDefault1e5-8   19.1MB/s ± 2%  20.2MB/s ± 3%  +5.69%  (p=0.000 n=10+10)
      EncodeDigitsDefault1e6-8   17.7MB/s ± 3%  19.2MB/s ± 2%  +8.31%  (p=0.000 n=10+10)
      EncodeDigitsCompress1e4-8  27.6MB/s ± 2%  29.1MB/s ± 1%  +5.47%   (p=0.000 n=10+9)
      EncodeDigitsCompress1e5-8  19.0MB/s ± 3%  20.1MB/s ± 2%  +5.78%  (p=0.000 n=10+10)
      EncodeDigitsCompress1e6-8  17.9MB/s ± 4%  19.2MB/s ± 1%  +7.50%  (p=0.000 n=10+10)
      EncodeTwainHuffman1e4-8     141MB/s ± 3%   154MB/s ± 1%  +9.46%   (p=0.000 n=10+9)
      EncodeTwainHuffman1e5-8     180MB/s ± 2%   191MB/s ± 2%  +6.19%  (p=0.000 n=10+10)
      EncodeTwainHuffman1e6-8     181MB/s ± 3%   192MB/s ± 2%  +6.02%  (p=0.000 n=10+10)
      EncodeTwainSpeed1e4-8      34.0MB/s ± 3%  35.3MB/s ± 1%  +3.84%  (p=0.000 n=10+10)
      EncodeTwainSpeed1e5-8      38.7MB/s ± 2%  40.3MB/s ± 1%  +4.30%   (p=0.000 n=10+9)
      EncodeTwainSpeed1e6-8      39.1MB/s ± 1%  41.2MB/s ± 1%  +5.57%   (p=0.000 n=9+10)
      EncodeTwainDefault1e4-8    23.9MB/s ± 2%  25.3MB/s ± 1%  +5.91%   (p=0.000 n=10+9)
      EncodeTwainDefault1e5-8    16.0MB/s ± 4%  17.4MB/s ± 1%  +8.47%   (p=0.000 n=10+9)
      EncodeTwainDefault1e6-8    15.1MB/s ± 2%  16.3MB/s ± 1%  +7.76%  (p=0.000 n=10+10)
      EncodeTwainCompress1e4-8   23.5MB/s ± 1%  24.7MB/s ± 1%  +5.24%   (p=0.000 n=9+10)
      EncodeTwainCompress1e5-8   14.7MB/s ± 1%  15.8MB/s ± 1%  +7.50%   (p=0.000 n=9+10)
      EncodeTwainCompress1e6-8   13.4MB/s ± 3%  14.6MB/s ± 1%  +8.57%   (p=0.000 n=10+9)
      
      Change-Id: I5c7e84c2f9ea4d38a2115995705eebb93387e22f
      Reviewed-on: https://go-review.googlesource.com/21759Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      f20b1809
    • Martin Möhrmann's avatar
      all: replace magic 0x80 with named constant utf8.RuneSelf · 012557b3
      Martin Möhrmann authored
      Change-Id: Id1c2e8e9d60588de866e8b6ca59cc83dd28f848f
      Reviewed-on: https://go-review.googlesource.com/21756Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      012557b3
    • Dmitry Vyukov's avatar
      internal/trace: fix a typo in error message · 527ffebb
      Dmitry Vyukov authored
      Change-Id: Id79eaa6d49dae80c334c7243b0a5bbcdcb9397d3
      Reviewed-on: https://go-review.googlesource.com/21758Reviewed-by: default avatarMikio Hara <mikioh.mikioh@gmail.com>
      527ffebb
    • Marvin Stenger's avatar
      cmd: remove bio.Bread · de7ee57c
      Marvin Stenger authored
      Replace calls to bio.Bread with calls to io.ReadFull.
      
      Change-Id: I2ee8739d01e04a4da9c20b6ce7d1d5b89914b8ad
      Reviewed-on: https://go-review.googlesource.com/21750Reviewed-by: default avatarDave Cheney <dave@cheney.net>
      de7ee57c
    • Emmanuel Odeke's avatar
      runtime: make execution error panic values implement the Error interface · e4f1d9cf
      Emmanuel Odeke authored
      Make execution panics implement Error as
      mandated by https://golang.org/ref/spec#Run_time_panics,
      instead of panics with strings.
      
      Fixes #14965
      
      Change-Id: I7827f898b9b9c08af541db922cc24fa0800ff18a
      Reviewed-on: https://go-review.googlesource.com/21214Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e4f1d9cf
    • Wisdom Omuya's avatar
      cmd/go: fix typo in findInternal documentation · 824d8c10
      Wisdom Omuya authored
      Fixes #15217
      
      Change-Id: Ib8f7af714197fd209e743f61f28a5b07c04a7f5c
      Reviewed-on: https://go-review.googlesource.com/21793Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      824d8c10
  2. 09 Apr, 2016 8 commits
  3. 08 Apr, 2016 15 commits
  4. 07 Apr, 2016 11 commits
    • Keith Randall's avatar
      cmd/compile: Fix constant-folding of unsigned shifts · 68ac1f77
      Keith Randall authored
      Make sure the results of unsigned constant-folded
      shifts are sign-extended into the AuxInt field.
      
      Fixes #15175
      
      Change-Id: I3490d1bc3d9b2e1578ed30964645508577894f58
      Reviewed-on: https://go-review.googlesource.com/21586Reviewed-by: default avatarAlexandru Moșoi <alexandru@mosoi.ro>
      Run-TryBot: Keith Randall <khr@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      68ac1f77
    • Cheng-Lung Sung's avatar
      cmd/go: revise importPath when ImportPath is 'command-line-arguments' · dfded578
      Cheng-Lung Sung authored
      Fixes #14613
      
      Change-Id: I40d9696db3879549e78373ef17f6c92bd4b3470b
      Reviewed-on: https://go-review.googlesource.com/21596Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      dfded578
    • Joe Tsai's avatar
      bytes, string: add Reset method to Reader · e88f8902
      Joe Tsai authored
      Currently, there is no easy allocation-free way to turn a
      []byte or string into an io.Reader. Thus, we add a Reset method
      to bytes.Reader and strings.Reader to allow the reuse of these
      Readers with another []byte or string.
      
      This is consistent with the fact that many standard library io.Readers
      already support a Reset method of some type:
      	bufio.Reader
      	flate.Reader
      	gzip.Reader
      	zlib.Reader
      	debug/dwarf.LineReader
      	bytes.Buffer
      	crypto/rc4.Cipher
      
      Fixes #15033
      
      Change-Id: I456fd1af77af6ef0b4ac6228b058ac1458ff3d19
      Reviewed-on: https://go-review.googlesource.com/21386Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e88f8902
    • Michael Munday's avatar
      runtime: add s390x support (new files and lfstack_64bit.go modifications) · e6f36f0c
      Michael Munday authored
      Change-Id: I51c0a332e3cbdab348564e5dcd27583e75e4b881
      Reviewed-on: https://go-review.googlesource.com/20946Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e6f36f0c
    • David Crawshaw's avatar
      cmd/link: hide go.dwarf symbols · 9658b7ef
      David Crawshaw authored
      Fixes #15179
      
      Change-Id: I0f70b7ae1682eafaece7f22d8e76f0aa806f3ec9
      Reviewed-on: https://go-review.googlesource.com/21589
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      9658b7ef
    • David Crawshaw's avatar
      cmd/link: disable DWARF when not generating symtab · e6181eb9
      David Crawshaw authored
      Fixes #15166
      
      Change-Id: I30284e3c0fb2c80b26a2572e2fb249b8018e85f9
      Reviewed-on: https://go-review.googlesource.com/21587
      Run-TryBot: David Crawshaw <crawshaw@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e6181eb9
    • Burcu Dogan's avatar
      C: fix jbd's identity · 39f1ecd1
      Burcu Dogan authored
      Change-Id: Ib4353710a742b1067723c7c6186e8639559668a3
      Reviewed-on: https://go-review.googlesource.com/21655Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      39f1ecd1
    • Brad Fitzpatrick's avatar
      context: mark more tests as flaky on OpenBSD · e2c09749
      Brad Fitzpatrick authored
      Updates #15158
      
      Change-Id: I53e9e68d36efbf52736822e6caa047cfff501283
      Reviewed-on: https://go-review.googlesource.com/21653Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      e2c09749
    • Aliaksandr Valialkin's avatar
      math/big: re-use memory in Int.GCD · 187afdeb
      Aliaksandr Valialkin authored
      This improves TLS handshake performance.
      
      benchmark                                 old ns/op     new ns/op     delta
      BenchmarkGCD10x10/WithoutXY-4             965           968           +0.31%
      BenchmarkGCD10x10/WithXY-4                1813          1391          -23.28%
      BenchmarkGCD10x100/WithoutXY-4            1093          1075          -1.65%
      BenchmarkGCD10x100/WithXY-4               2348          1676          -28.62%
      BenchmarkGCD10x1000/WithoutXY-4           1569          1565          -0.25%
      BenchmarkGCD10x1000/WithXY-4              4262          3242          -23.93%
      BenchmarkGCD10x10000/WithoutXY-4          6069          6066          -0.05%
      BenchmarkGCD10x10000/WithXY-4             12123         11331         -6.53%
      BenchmarkGCD10x100000/WithoutXY-4         52664         52610         -0.10%
      BenchmarkGCD10x100000/WithXY-4            97494         95649         -1.89%
      BenchmarkGCD100x100/WithoutXY-4           5244          5228          -0.31%
      BenchmarkGCD100x100/WithXY-4              22572         18630         -17.46%
      BenchmarkGCD100x1000/WithoutXY-4          6143          6233          +1.47%
      BenchmarkGCD100x1000/WithXY-4             24652         19357         -21.48%
      BenchmarkGCD100x10000/WithoutXY-4         15725         15804         +0.50%
      BenchmarkGCD100x10000/WithXY-4            60552         55973         -7.56%
      BenchmarkGCD100x100000/WithoutXY-4        107008        107853        +0.79%
      BenchmarkGCD100x100000/WithXY-4           349597        340994        -2.46%
      BenchmarkGCD1000x1000/WithoutXY-4         63785         64434         +1.02%
      BenchmarkGCD1000x1000/WithXY-4            373186        334035        -10.49%
      BenchmarkGCD1000x10000/WithoutXY-4        78038         78241         +0.26%
      BenchmarkGCD1000x10000/WithXY-4           543692        507034        -6.74%
      BenchmarkGCD1000x100000/WithoutXY-4       205607        207727        +1.03%
      BenchmarkGCD1000x100000/WithXY-4          2488113       2415323       -2.93%
      BenchmarkGCD10000x10000/WithoutXY-4       1731340       1714992       -0.94%
      BenchmarkGCD10000x10000/WithXY-4          10601046      7111329       -32.92%
      BenchmarkGCD10000x100000/WithoutXY-4      2239155       2212173       -1.21%
      BenchmarkGCD10000x100000/WithXY-4         30097040      26538887      -11.82%
      BenchmarkGCD100000x100000/WithoutXY-4     119845326     119863916     +0.02%
      BenchmarkGCD100000x100000/WithXY-4        768006543     426795966     -44.43%
      
      benchmark                                 old allocs     new allocs     delta
      BenchmarkGCD10x10/WithoutXY-4             5              5              +0.00%
      BenchmarkGCD10x10/WithXY-4                17             9              -47.06%
      BenchmarkGCD10x100/WithoutXY-4            6              6              +0.00%
      BenchmarkGCD10x100/WithXY-4               21             9              -57.14%
      BenchmarkGCD10x1000/WithoutXY-4           6              6              +0.00%
      BenchmarkGCD10x1000/WithXY-4              30             12             -60.00%
      BenchmarkGCD10x10000/WithoutXY-4          6              6              +0.00%
      BenchmarkGCD10x10000/WithXY-4             26             12             -53.85%
      BenchmarkGCD10x100000/WithoutXY-4         6              6              +0.00%
      BenchmarkGCD10x100000/WithXY-4            28             12             -57.14%
      BenchmarkGCD100x100/WithoutXY-4           5              5              +0.00%
      BenchmarkGCD100x100/WithXY-4              183            61             -66.67%
      BenchmarkGCD100x1000/WithoutXY-4          8              8              +0.00%
      BenchmarkGCD100x1000/WithXY-4             170            47             -72.35%
      BenchmarkGCD100x10000/WithoutXY-4         8              8              +0.00%
      BenchmarkGCD100x10000/WithXY-4            200            67             -66.50%
      BenchmarkGCD100x100000/WithoutXY-4        8              8              +0.00%
      BenchmarkGCD100x100000/WithXY-4           188            65             -65.43%
      BenchmarkGCD1000x1000/WithoutXY-4         5              5              +0.00%
      BenchmarkGCD1000x1000/WithXY-4            2435           1193           -51.01%
      BenchmarkGCD1000x10000/WithoutXY-4        8              8              +0.00%
      BenchmarkGCD1000x10000/WithXY-4           2211           1076           -51.33%
      BenchmarkGCD1000x100000/WithoutXY-4       8              8              +0.00%
      BenchmarkGCD1000x100000/WithXY-4          2271           1108           -51.21%
      BenchmarkGCD10000x10000/WithoutXY-4       5              5              +0.00%
      BenchmarkGCD10000x10000/WithXY-4          23183          11605          -49.94%
      BenchmarkGCD10000x100000/WithoutXY-4      8              8              +0.00%
      BenchmarkGCD10000x100000/WithXY-4         23421          11717          -49.97%
      BenchmarkGCD100000x100000/WithoutXY-4     5              5              +0.00%
      BenchmarkGCD100000x100000/WithXY-4        232976         116815         -49.86%
      
      benchmark                                 old bytes      new bytes     delta
      BenchmarkGCD10x10/WithoutXY-4             208            208           +0.00%
      BenchmarkGCD10x10/WithXY-4                736            432           -41.30%
      BenchmarkGCD10x100/WithoutXY-4            256            256           +0.00%
      BenchmarkGCD10x100/WithXY-4               896            432           -51.79%
      BenchmarkGCD10x1000/WithoutXY-4           368            368           +0.00%
      BenchmarkGCD10x1000/WithXY-4              1856           1152          -37.93%
      BenchmarkGCD10x10000/WithoutXY-4          1616           1616          +0.00%
      BenchmarkGCD10x10000/WithXY-4             7920           7376          -6.87%
      BenchmarkGCD10x100000/WithoutXY-4         13776          13776         +0.00%
      BenchmarkGCD10x100000/WithXY-4            68800          68176         -0.91%
      BenchmarkGCD100x100/WithoutXY-4           208            208           +0.00%
      BenchmarkGCD100x100/WithXY-4              6960           2112          -69.66%
      BenchmarkGCD100x1000/WithoutXY-4          544            560           +2.94%
      BenchmarkGCD100x1000/WithXY-4             7280           2400          -67.03%
      BenchmarkGCD100x10000/WithoutXY-4         2896           2912          +0.55%
      BenchmarkGCD100x10000/WithXY-4            15280          10002         -34.54%
      BenchmarkGCD100x100000/WithoutXY-4        27344          27365         +0.08%
      BenchmarkGCD100x100000/WithXY-4           88288          83427         -5.51%
      BenchmarkGCD1000x1000/WithoutXY-4         544            544           +0.00%
      BenchmarkGCD1000x1000/WithXY-4            178288         40043         -77.54%
      BenchmarkGCD1000x10000/WithoutXY-4        3344           3136          -6.22%
      BenchmarkGCD1000x10000/WithXY-4           188720         54432         -71.16%
      BenchmarkGCD1000x100000/WithoutXY-4       27792          27592         -0.72%
      BenchmarkGCD1000x100000/WithXY-4          373872         239447        -35.95%
      BenchmarkGCD10000x10000/WithoutXY-4       4288           4288          +0.00%
      BenchmarkGCD10000x10000/WithXY-4          11935584       481875        -95.96%
      BenchmarkGCD10000x100000/WithoutXY-4      31296          28834         -7.87%
      BenchmarkGCD10000x100000/WithXY-4         13237088       1662620       -87.44%
      BenchmarkGCD100000x100000/WithoutXY-4     40768          40768         +0.00%
      BenchmarkGCD100000x100000/WithXY-4        1165518864     14256010      -98.78%
      
      Change-Id: I652b3244bd074a03f3bc9a87c282330f9e5f1507
      Reviewed-on: https://go-review.googlesource.com/21506Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      187afdeb
    • Michael Munday's avatar
      math/big: add s390x function implementations · 1e7c61d8
      Michael Munday authored
      Change-Id: I2aadc885d6330460e494c687757f07c5e006f3b0
      Reviewed-on: https://go-review.googlesource.com/20937Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      1e7c61d8
    • Michael Munday's avatar
      sync/atomic: add s390x implementations of atomic functions · 7da42d75
      Michael Munday authored
      Load and store instructions are atomic on s390x.
      
      Change-Id: I33c641a75954f4fbd301b11a467cb57872038880
      Reviewed-on: https://go-review.googlesource.com/20947Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      7da42d75