commit | 80b4bdf5e712d1831a7698a588c62d4d81514c3a | [log] [tgz] |
---|---|---|
author | Marcel van Lohuizen <mpvl@golang.org> | Wed Oct 31 11:24:54 2018 +0100 |
committer | Marcel van Lohuizen <mpvl@golang.org> | Mon Nov 26 08:57:44 2018 +0000 |
tree | a2d101f64d9833d839f9c365861306c82d3c5bf4 | |
parent | ddaa976d14a4c19293cb29151aae208eedea4b62 [diff] |
errors/fmt: added benchmarks for stack trace Removing the intermediate errorf improves performance by 12-18%. Old: with intermediate errorf, New: errorf removed: name old time/op new time/op delta Errorf/no_format/ExpWithTrace-8 626ns ± 6% 514ns ± 8% -17.92% (p=0.029 n=4+4) Errorf/no_format/ExpNoTrace-8 116ns ± 1% 112ns ± 1% -3.03% (p=0.029 n=4+4) Errorf/no_format/Core-8 226ns ± 1% 227ns ± 1% ~ (p=0.714 n=4+4) Errorf/with_format/ExpWithTrace-8 668ns ± 1% 564ns ± 1% -15.59% (p=0.029 n=4+4) Errorf/with_format/ExpNoTrace-8 170ns ± 1% 166ns ± 2% ~ (p=0.057 n=4+4) Errorf/with_format/Core-8 274ns ± 1% 272ns ± 1% ~ (p=0.343 n=4+4) Errorf/method:_mytype/ExpWithTrace-8 938ns ± 2% 820ns ± 1% -12.56% (p=0.029 n=4+4) Errorf/method:_mytype/ExpNoTrace-8 404ns ± 2% 390ns ± 2% -3.47% (p=0.029 n=4+4) Errorf/method:_mytype/Core-8 358ns ± 1% 358ns ± 1% ~ (p=0.657 n=4+4) Errorf/method:_number/ExpWithTrace-8 1.03µs ± 1% 0.90µs ± 1% -12.70% (p=0.029 n=4+4) Errorf/method:_number/ExpNoTrace-8 496ns ± 2% 480ns ± 0% -3.12% (p=0.029 n=4+4) Errorf/method:_number/Core-8 652ns ± 2% 659ns ± 2% ~ (p=0.343 n=4+4) Change-Id: Ied17d4265342507f7c9c39977f2fddd416c6e503 Reviewed-on: https://go-review.googlesource.com/c/146197 Run-TryBot: Marcel van Lohuizen <mpvl@golang.org> Reviewed-by: Russ Cox <rsc@golang.org>
This subrepository holds experimental and deprecated (in the old
directory) packages.
The idea for this subrepository originated as the pkg/exp
directory of the main repository, but its presence there made it unavailable to users of the binary downloads of the Go installation. The subrepository has therefore been created to make it possible to go get
these packages.
Warning: Packages here are experimental and unreliable. Some may one day be promoted to the main repository or other subrepository, or they may be modified arbitrarily or even disappear altogether.
In short, code in this subrepository is not subject to the Go 1 compatibility promise. (No subrepo is, but the promise is even more likely to be violated by go.exp than the others.)
Caveat emptor.