apd icon indicating copy to clipboard operation
apd copied to clipboard

apd: Improve string conversion efficiency

Open miretskiy opened this issue 4 years ago • 0 comments

Prefer to use Append and allocate scratch space to improve speed and efficiency of string conversion:

name              old time/op    new time/op    delta
DecimalString-10     147ns ± 1%      56ns ± 4%  -62.14%  (p=0.000
n=10+10)

name              old alloc/op   new alloc/op   delta
DecimalString-10     84.0B ± 0%     39.0B ± 0%  -53.57%  (p=0.000
n=10+10)

name              old allocs/op  new allocs/op  delta
DecimalString-10      5.00 ± 0%      1.00 ± 0%  -80.00%  (p=0.000
n=10+10)

miretskiy avatar Oct 15 '22 20:10 miretskiy