dtoa-benchmark

ryzen-threadripper-3960x_linux_gcc13.3_a10220f

Time per double (lower is better)

MethodTime (ns)Speedup
zmij16.24
xjb6419.62
yy21.40
dragonbox24.76
uscale28.96
fmt31.55
schubfach34.49
ryu43.99
to_chars52.17
double-conversion83.20
sprintf517.68
ostringstream781.02

Click any row to use it as the speedup baseline.

Times include a fixed loop-overhead floor of 1.17 ns (measured with a no-op stand-in for dtoa).

zmij16.24 nsxjb6419.62 nsyy21.40 nsdragonbox24.76 nsuscale28.96 nsfmt31.55 nsschubfach34.49 nsryu43.99 nsto_chars52.17 nsdouble-conversion83.20 ns

ostringstream and sprintf omitted; they are an order of magnitude slower than the rest.

Time vs. digit count (log scale)

12345678910111213141516171510501005001,0000DigitsTime (ns)loop overhead (1.17 ns)

Hover or click a method to highlight its series.