dtoa-benchmark

apple-m1-pro_macos_clang21.0_359383b

Time per double (lower is better)

MethodTime (ns)Speedup
zmij6.51
xjb646.92
yy13.38
dragonbox20.92
fmt22.13
schubfach25.06
uscale28.50
ryu36.92
to_chars41.77
double-conversion84.70
sprintf730.38
ostringstream871.91

Click any row to use it as the speedup baseline.

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

zmij6.51 nsxjb646.92 nsyy13.38 nsdragonbox20.92 nsfmt22.13 nsschubfach25.06 nsuscale28.50 nsryu36.92 nsto_chars41.77 nsdouble-conversion84.70 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 (0.94 ns)

Hover or click a method to highlight its series.