dtoa-benchmark

apple-m5-max_macos_clang21.0_ab145b9

Time per double (lower is better)

MethodTime (ns)Speedup
zmij3.93
xjb644.17
yy16.61
dragonbox20.26
fmt24.40
uscale28.83
ryu30.45
to_chars34.23
schubfach34.58
double-conversion50.90
sprintf399.75
ostringstream471.70

Click any row to use it as the speedup baseline.

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

zmij3.93 nsxjb644.17 nsyy16.61 nsdragonbox20.26 nsfmt24.40 nsuscale28.83 nsryu30.45 nsto_chars34.23 nsschubfach34.58 nsdouble-conversion50.90 ns

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

Time vs. digit count (log scale)

12345678910111213141516170.51510501005000DigitsTime (ns)loop overhead (0.60 ns)

Hover or click a method to highlight its series.