1. 27 Oct, 2016 35 commits
  2. 26 Oct, 2016 5 commits
    • Bill O'Farrell's avatar
      math/big: uses SIMD for some math big functions on s390x · 1e6b12a2
      Bill O'Farrell authored
      The following benchmarks are improved by the amounts shown
      (Others unaffected beyond the level of noise.)
      Also adds a test to confirm non-SIMD implementation still correct,
      even when run on SIMD-capable machine
      
      Benchmark                   old            new
      BenchmarkAddVV/100-18    66148.08 MB/s 117546.19 MB/s 1.8x
      BenchmarkAddVV/1000-18   70168.27 MB/s 133478.96 MB/s 1.9x
      BenchmarkAddVV/10000-18  67489.80 MB/s 100010.79 MB/s 1.5x
      BenchmarkAddVV/100000-18 54329.99 MB/s  69232.45 MB/s 1.3x
      BenchmarkAddVW/100-18     9929.10 MB/s  14841.31 MB/s 1.5x
      BenchmarkAddVW/1000-18   10583.31 MB/s  18674.44 MB/s 1.76x
      BenchmarkAddVW/10000-18  10521.15 MB/s  17484.10 MB/s 1.66x
      BenchmarkAddVW/100000-18 10616.56 MB/s  18084.27 MB/s 1.7x
      
      Change-Id: Ic9234c41a43f6c5e9d0e9377de8b4deeefc428a7
      Reviewed-on: https://go-review.googlesource.com/32211Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      1e6b12a2
    • Ben Burkert's avatar
      crypto/tls: add CloseWrite method to Conn · 829aa673
      Ben Burkert authored
      The CloseWrite method sends a close_notify alert record to the other
      side of the connection. This record indicates that the sender has
      finished sending on the connection. Unlike the Close method, the sender
      may still read from the connection until it recieves a close_notify
      record (or the underlying connection is closed). This is analogous to a
      TCP half-close.
      
      This is a rework of CL 25159 with fixes for the unstable test.
      
      Updates #8579
      
      Change-Id: I47608d2f82a88baff07a90fd64c280ed16a60d5e
      Reviewed-on: https://go-review.googlesource.com/31318Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      829aa673
    • Joe Tsai's avatar
      unicode/utf8: optimize ValidRune · 8eca0861
      Joe Tsai authored
      Re-writing the switch statement as a single boolean expression
      reduces the number of branches that the compiler generates.
      It is also arguably easier to read as a pair of numeric ranges
      that valid runes can exist in.
      
      No test changes since the existing test does a good job of
      testing all of the boundaries.
      
      This change was to gain back some performance after a correctness
      fix done in http://golang.org/cl/32123.
      
      The correctness fix (CL/32123) slowed down the benchmarks slightly:
      	benchmark                   old ns/op     new ns/op     delta
      	BenchmarkIndexRune/10-4     19.3          21.6          +11.92%
      	BenchmarkIndexRune/32-4     33.6          35.2          +4.76%
      
      Since the fix relies on utf8.ValidRune, this CL improves benchmarks:
      	benchmark                   old ns/op     new ns/op     delta
      	BenchmarkIndexRune/10-4     21.6          20.0          -7.41%
      	BenchmarkIndexRune/32-4     35.2          33.5          -4.83%
      
      Change-Id: Ib1ca10a2e29c90e879a8ef9b7221c33e85d015d8
      Reviewed-on: https://go-review.googlesource.com/32122
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      8eca0861
    • Robert Griesemer's avatar
      go/scanner: recognize invalid floating-point constant exponent · 3cfc757c
      Robert Griesemer authored
      Fixes #17621.
      
      Change-Id: Id3e75c9b7fba2cf8e791c8817f890556ca238e9d
      Reviewed-on: https://go-review.googlesource.com/32096Reviewed-by: default avatarJosh Bleecher Snyder <josharian@gmail.com>
      3cfc757c
    • Joe Tsai's avatar
      bytes, strings: fix regression in IndexRune · 4b266578
      Joe Tsai authored
      In all previous versions of Go, the behavior of IndexRune(s, r)
      where r was utf.RuneError was that it would effectively return the
      index of any invalid UTF-8 byte sequence (include RuneError).
      Optimizations made in http://golang.org/cl/28537 and
      http://golang.org/cl/28546 altered this undocumented behavior such
      that RuneError would only match on the RuneError rune itself.
      
      Although, the new behavior is arguably reasonable, it did break code
      that depended on the previous behavior. Thus, we add special checks
      to ensure that we preserve the old behavior.
      
      There is a slight performance hit for correctness:
      	benchmark                   old ns/op     new ns/op     delta
      	BenchmarkIndexRune/10-4     19.3          21.6          +11.92%
      	BenchmarkIndexRune/32-4     33.6          35.2          +4.76%
      This only occurs on small strings. The performance hit for larger strings
      is neglible and not shown.
      
      Fixes #17611
      
      Change-Id: I1d863a741213d46c40b2e1724c41245df52502a5
      Reviewed-on: https://go-review.googlesource.com/32123
      Run-TryBot: Joe Tsai <thebrokentoaster@gmail.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      4b266578