mirror of
https://github.com/golang/go
synced 2024-11-22 21:10:03 -07:00
a2eb53c571
Also fix BenchmarkAtof64Random* to initialize the test data when none of the TestAtof* tests are run. Passing "go test -test.count=5 -test.run=xxx -test.bench=Atof64" on to benchstat: name old time/op new time/op delta Atof64Decimal-4 47.9ns ± 0% 48.3ns ± 1% ~ (p=0.238 n=4+5) Atof64Float-4 58.3ns ± 3% 57.7ns ± 0% ~ (p=0.151 n=5+5) Atof64FloatExp-4 107ns ± 0% 71ns ± 1% -33.89% (p=0.016 n=4+5) Atof64Big-4 163ns ± 0% 166ns ± 2% ~ (p=0.159 n=4+5) Atof64RandomBits-4 299ns ± 1% 166ns ± 1% -44.41% (p=0.008 n=5+5) Atof64RandomFloats-4 188ns ± 1% 144ns ± 0% -23.03% (p=0.008 n=5+5) The canada.json file from github.com/miloyip/nativejson-benchmark is full of geospatial coordinates (i.e. numbers). With this program: src, _ := ioutil.ReadFile("canada.json") for i := 0; i < 5; i++ { now := time.Now() for j := 0; j < 10; j++ { dst := interface{}(nil) if err := json.Unmarshal(src, &dst); err != nil { log.Fatal(err) } } fmt.Println(time.Since(now)) } Median of the 5 printed numbers, lower is better. Before: 760.819549ms After: 702.651646ms Ratio: 1.08x The new detailedPowersOfTen table weighs in at 596 * 16 = 9536 bytes, but some of that weight gain can be clawed back, in a follow-up commit, that folds in the existing powersOfTen table in extfloat.go. RELNOTE=yes Change-Id: I3953110deaa1f5f6941e88e8417c4665b649ed80 Reviewed-on: https://go-review.googlesource.com/c/go/+/260858 Run-TryBot: Nigel Tao <nigeltao@golang.org> TryBot-Result: Go Bot <gobot@golang.org> Reviewed-by: Robert Griesemer <gri@golang.org> Trust: Nigel Tao <nigeltao@golang.org> |
||
---|---|---|
.. | ||
articles | ||
codewalk | ||
gopher | ||
play | ||
progs | ||
asm.html | ||
cmd.html | ||
contribute.html | ||
debugging_with_gdb.html | ||
diagnostics.html | ||
editors.html | ||
effective_go.html | ||
gccgo_contribute.html | ||
gccgo_install.html | ||
go1.1.html | ||
go1.2.html | ||
go1.3.html | ||
go1.4.html | ||
go1.5.html | ||
go1.6.html | ||
go1.7.html | ||
go1.8.html | ||
go1.9.html | ||
go1.10.html | ||
go1.11.html | ||
go1.12.html | ||
go1.13.html | ||
go1.14.html | ||
go1.15.html | ||
go1.16.html | ||
go1.html | ||
go1compat.html | ||
go_faq.html | ||
go_mem.html | ||
go_spec.html | ||
go-logo-black.png | ||
go-logo-blue.png | ||
go-logo-white.png | ||
help.html | ||
ie.css | ||
install-source.html | ||
install.html | ||
share.png | ||
tos.html |