]> Cypherpunks repositories - gostls13.git/commit
encoding/json: make BenchmarkSkipValue more stable
authorJosh Bleecher Snyder <josharian@gmail.com>
Thu, 14 May 2015 02:27:59 +0000 (19:27 -0700)
committerJosh Bleecher Snyder <josharian@gmail.com>
Thu, 14 May 2015 02:32:28 +0000 (02:32 +0000)
commitdbf533a5460d7fcc7d7be77014fd74a8aff8c412
tree35f0cf71e5730df8e77e4ed70bc5a2937e0497a9
parentef54930ebb65f1d611cb321eb86062fd4accc0ff
encoding/json: make BenchmarkSkipValue more stable

BenchmarkSkipValue was sensitive to the value of
b.N due to its significant startup cost.

Two adjacent runs before this CL:

BenchmarkSkipValue       50   21047499 ns/op   93.37 MB/s
BenchmarkSkipValue      100   17260554 ns/op  118.05 MB/s

After this CL, using benchtime to recreate the
difference in b.N:

BenchmarkSkipValue       50   15204797 ns/op  131.67 MB/s
BenchmarkSkipValue      100   15332319 ns/op  130.58 MB/s

Change-Id: Iac86f86dd774d535302fa5e4c08f89f8da00be9e
Reviewed-on: https://go-review.googlesource.com/10053
Reviewed-by: Andrew Gerrand <adg@golang.org>
src/encoding/json/scanner_test.go