80b4bdf5e7
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> |
||
---|---|---|
.. | ||
internal.go |