1. 01 Mar, 2016 11 commits
  2. 29 Feb, 2016 16 commits
  3. 28 Feb, 2016 10 commits
    • Tamir Duberstein's avatar
      crypto/tls: don't log expected errors in test · 622780b1
      Tamir Duberstein authored
      This is minor cleanup that reduces test output noise.
      
      Change-Id: Ib6db4daf8cb67b7784b2d5b222fa37c7f78a6a04
      Reviewed-on: https://go-review.googlesource.com/19997Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      622780b1
    • Tamir Duberstein's avatar
      crypto/tls: tests prefer constants to opaque literals · 186d3e30
      Tamir Duberstein authored
      This is minor cleanup that makes the tests more readable.
      
      Change-Id: I9f1f98f0f035096c284bdf3501e7520517a3e4d9
      Reviewed-on: https://go-review.googlesource.com/19993Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      186d3e30
    • Justin Nuß's avatar
      mime: Fix BenchmarkQDecodeHeader to call DecodeHeader · 92408107
      Justin Nuß authored
      Found this while reading through the code. The benchmark
      accidently called the wrong function.
      
      Change-Id: Idb88aa71e7098a4e29e7f5f39e64f8c5f8936a2a
      Reviewed-on: https://go-review.googlesource.com/19977Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      92408107
    • Joe Tsai's avatar
      compress/bzip2: fix benchmark to actually measure decompression rate · ff274210
      Joe Tsai authored
      Motivation:
      * Previously, the size of the compressed data was used for metrics,
      rather than the uncompressed size. This causes the library to appear
      to perform poorly relative to C or other implementation. Switch it
      to use the uncompressed size so that it matches how decompression
      benchmarks are usually done (like in compress/flate). This also makes
      it easier to compare bzip2 rates to other algorithms since they measure
      performance in this way.
      * Also, reset the timer after doing initialization work.
      
      Change-Id: I32112c2ee8e7391e658c9cf31039f70a689d9b9d
      Reviewed-on: https://go-review.googlesource.com/17611Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      Run-TryBot: Brad Fitzpatrick <bradfitz@golang.org>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      ff274210
    • Joe Tsai's avatar
      compress/bzip2: use correct block size · 47379929
      Joe Tsai authored
      The bzip2 block size is a multiple of 100*1000 not 100*1024.
      Thus, the bzip2 decoder would incorrectly decode files with larger
      block sizes when it should have otherwise failed.
      Fortunately, we can correct this in a backwards compatible way since
      Go has no implementation of a bzip2 encoder to produce bad blocks :)
      
      To confirm that the C bzip2 utlity chokes on this data:
      	$ echo "425a683131415926535936dc55330063ffc0006000200020a40830008b00
      	08b8bb9229c28481b6e2a998" | xxd -r -p | bzip2 -d
      
      	bzip2: Data integrity error when decompressing.
      
      Fixes #13941
      
      Change-Id: I2402e8829a8027ef94dd4fac050b200440a3d4e4
      Reviewed-on: https://go-review.googlesource.com/20011
      Run-TryBot: Joe Tsai <joetsai@digital-static.net>
      Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      47379929
    • Joe Tsai's avatar
      compress/flate: extract LZ77 dictionary logic into seperate struct · 5fc4decd
      Joe Tsai authored
      The LZ77 portion of DEFLATE is relatively self-contained. For the
      decompression side of things, we extract this logic out for the
      following reasons:
      * It is easier to test just the LZ77 portion of the logic.
      * It reduces the noise in the inflate.go
      
      Also, we adjust the way that callbacks are handled in the inflate.
      Instead of using functions to abstract the logical componets of
      huffmanBlock(), use goto statements to jump between the necessary
      sections. This is faster since it avoids a function call and is
      arguably more readable.
      
      benchmark                              old MB/s     new MB/s     speedup
      BenchmarkDecodeDigitsSpeed1e4-4        53.62        60.11        1.12x
      BenchmarkDecodeDigitsSpeed1e5-4        61.90        69.07        1.12x
      BenchmarkDecodeDigitsSpeed1e6-4        63.24        70.58        1.12x
      BenchmarkDecodeDigitsDefault1e4-4      54.10        59.00        1.09x
      BenchmarkDecodeDigitsDefault1e5-4      69.50        74.07        1.07x
      BenchmarkDecodeDigitsDefault1e6-4      71.54        75.85        1.06x
      BenchmarkDecodeDigitsCompress1e4-4     54.39        58.94        1.08x
      BenchmarkDecodeDigitsCompress1e5-4     69.21        73.96        1.07x
      BenchmarkDecodeDigitsCompress1e6-4     71.14        75.75        1.06x
      BenchmarkDecodeTwainSpeed1e4-4         53.15        58.13        1.09x
      BenchmarkDecodeTwainSpeed1e5-4         66.56        72.29        1.09x
      BenchmarkDecodeTwainSpeed1e6-4         69.13        75.11        1.09x
      BenchmarkDecodeTwainDefault1e4-4       56.00        60.23        1.08x
      BenchmarkDecodeTwainDefault1e5-4       77.84        82.27        1.06x
      BenchmarkDecodeTwainDefault1e6-4       82.07        86.85        1.06x
      BenchmarkDecodeTwainCompress1e4-4      56.13        60.38        1.08x
      BenchmarkDecodeTwainCompress1e5-4      78.23        82.62        1.06x
      BenchmarkDecodeTwainCompress1e6-4      82.38        86.73        1.05x
      
      Change-Id: I8c6ae0e6bed652dd0570fc113c999977f5e71636
      Reviewed-on: https://go-review.googlesource.com/16528Reviewed-by: default avatarMatthew Dempsky <mdempsky@google.com>
      Run-TryBot: Matthew Dempsky <mdempsky@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      5fc4decd
    • Caio Marcelo de Oliveira Filho's avatar
      testing: make failure in benchmark cause non-zero exit status · 3cb870d4
      Caio Marcelo de Oliveira Filho authored
      Moves the implementation of RunBenchmarks to a non-exported function
      that returns whether the execution was OK, and uses that to identify
      failure in benchmarks.The exported function is kept for compatibility.
      
      Like before, benchmarks will only be executed if tests and examples
      pass. The PASS message will not be printed if there was a failure in
      a benchmark.
      
      Example output
      
      	BenchmarkThatCallsFatal-8	--- FAIL: BenchmarkThatCallsFatal-8
      		x_test.go:6: called by benchmark
      	FAIL
      	exit status 1
      	FAIL	_/.../src/cmd/go/testdata/src/benchfatal	0.009s
      
      Fixes #14307.
      
      Change-Id: I6f3ddadc7da8a250763168cc099ae8b325a79602
      Reviewed-on: https://go-review.googlesource.com/19889Reviewed-by: default avatarIan Lance Taylor <iant@golang.org>
      3cb870d4
    • Ian Lance Taylor's avatar
      cmd/cgo: add hooks for thread sanitizer · c8ef0df0
      Ian Lance Taylor authored
      When Go code is used with C code compiled with -fsanitize=thread, adds
      thread sanitizer calls so that correctly synchronized Go code does not
      cause spurious failure reports from the thread sanitizer.  This may
      cause some false negatives, but for the thread sanitizer what is most
      important is avoiding false positives.
      
      Change-Id: If670e4a6f2874c7a2be2ff7db8728c6036340a52
      Reviewed-on: https://go-review.googlesource.com/17421Reviewed-by: default avatarDmitry Vyukov <dvyukov@google.com>
      c8ef0df0
    • kortschak's avatar
      misc/cgo/fortran: clean up after successful helloworld.90 build · c86dbbe1
      kortschak authored
      Change-Id: If03185a21e088c9b383a82c14d649805f00c8042
      Reviewed-on: https://go-review.googlesource.com/20000Reviewed-by: default avatarMinux Ma <minux@golang.org>
      c86dbbe1
    • Austin Clements's avatar
      runtime: clean up adjustpointer and eliminate write barrier · d62d8318
      Austin Clements authored
      Commit a5c3bbe0 modified adjustpointers to use *uintptrs instead of
      *unsafe.Pointers for manipulating stack pointers for clarity and to
      eliminate the unnecessary write barrier when writing the updated stack
      pointer.
      
      This commit makes the equivalent change to adjustpointer.
      
      Change-Id: I6dc309590b298bdd86ecdc9737db848d6786c3f7
      Reviewed-on: https://go-review.googlesource.com/17148Reviewed-by: default avatarRick Hudson <rlh@golang.org>
      Run-TryBot: Austin Clements <austin@google.com>
      TryBot-Result: Gobot Gobot <gobot@golang.org>
      d62d8318
  4. 27 Feb, 2016 3 commits
    • Ian Lance Taylor's avatar
      cmd/cgo: recognize known C typedefs as types · 71cc445c
      Ian Lance Taylor authored
      Fixes #14483.
      
      Change-Id: I0cddfe27fd8d00ba85659d0b618410e39ebf45cb
      Reviewed-on: https://go-review.googlesource.com/19860Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      71cc445c
    • Ian Lance Taylor's avatar
      cmd/compile: change Func.Cvars to the new Nodes type · 922ce58d
      Ian Lance Taylor authored
      Update #14473.
      
      Change-Id: Iba1ecf42d9ab5a93144941439d5cc6b0b4f4a3ac
      Reviewed-on: https://go-review.googlesource.com/19992Reviewed-by: default avatarBrad Fitzpatrick <bradfitz@golang.org>
      922ce58d
    • Martin Möhrmann's avatar
      fmt: simplify buffer write methods and adjust calls to them · 7da4cedd
      Martin Möhrmann authored
      Once upon a time fmt did use bytes.Buffer for its buffer.
      The buffer write methods still mimic the bytes.Buffer signatures.
      The current code depends on manipulating the buffer []bytes array directly
      which makes going back to bytes.Buffer by only changing the type of buffer
      impossible. Since type buffer is not exported the methods can be simplified
      to the needs of fmt. This saves space and avoids unnecessary overhead.
      
      Use WriteString instead of Write for known inputs since
      WriteString is faster than Write to append the same data.
      This also saves space in the binary.
      
      Remove the add method from Printer and depending on the data to be written
      use WriteRune or WriteByte directly instead.
      
      In total makes the go binary around 4 kilobyte smaller.
      
      name                  old time/op  new time/op  delta
      SprintfEmpty-2        24.1ns ± 3%  23.8ns ± 1%  -1.14%  (p=0.000 n=20+20)
      SprintfString-2        114ns ± 2%   114ns ± 4%    ~     (p=0.558 n=20+19)
      SprintfInt-2           116ns ± 9%   118ns ± 7%    ~     (p=0.086 n=20+20)
      SprintfIntInt-2        195ns ± 6%   193ns ± 5%    ~     (p=0.345 n=20+19)
      SprintfPrefixedInt-2   251ns ±16%   241ns ± 9%  -3.69%  (p=0.024 n=20+19)
      SprintfFloat-2         203ns ± 4%   205ns ± 5%    ~     (p=0.153 n=20+20)
      SprintfBoolean-2       101ns ± 7%    96ns ±11%  -5.23%  (p=0.005 n=19+20)
      ManyArgs-2             651ns ± 7%   628ns ± 7%  -3.44%  (p=0.002 n=20+20)
      FprintInt-2            164ns ± 2%   158ns ± 2%  -3.62%  (p=0.000 n=20+18)
      FprintfBytes-2         215ns ± 1%   216ns ± 1%  +0.58%  (p=0.000 n=20+20)
      FprintIntNoAlloc-2     115ns ± 0%   112ns ± 0%  -2.61%  (p=0.000 n=20+20)
      ScanInts-2             700µs ± 0%   702µs ± 1%  +0.38%  (p=0.000 n=18+20)
      ScanRecursiveInt-2    82.7ms ± 0%  82.7ms ± 0%    ~     (p=0.820 n=20+20)
      
      Change-Id: I0409eb170b8a26d9f4eb271f6292e5d39faf2d8b
      Reviewed-on: https://go-review.googlesource.com/19955Reviewed-by: default avatarRob Pike <r@golang.org>
      7da4cedd