apd
apd copied to clipboard
apd: Improve string conversion efficiency
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)