Open odeke-em opened 2 years ago
Noticed from Orijtech's continuous benchmarking product "Bencher" per
https://dashboard.github.orijtech.com/benchmark/3245b8e4bbbd44a597480319aaa4b9fe
that there is a bunch of code in the wild that invokes:
fmt.Sprintf("%s", string([]byte(...)))
yet the "%s" format specifier in fmt has a purpose:
%s the uninterpreted bytes of the string or slice
We can improve and reduce allocations simply by invoking
fmt.Sprintf("%s", []byte(...))
which led to big improvements across every dimension:
/cc @kirbyquerby @willpoint
Noticed from Orijtech's continuous benchmarking product "Bencher" per
https://dashboard.github.orijtech.com/benchmark/3245b8e4bbbd44a597480319aaa4b9fe
that there is a bunch of code in the wild that invokes:
yet the "%s" format specifier in fmt has a purpose:
We can improve and reduce allocations simply by invoking
which led to big improvements across every dimension:
/cc @kirbyquerby @willpoint