dtoa-benchmark

apple-m1-pro_macos_clang21.0_45ff4d4

Time per double (lower is better)

MethodTime (ns)Speedup
zmij6.45
xjb646.99
yy24.63
dragonbox28.95
fmt36.84
uscale45.86
ryu46.07
to_chars51.35
schubfach53.62
double-conversion87.43
sprintf744.72
ostringstream885.30

Click any row to use it as the speedup baseline.

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

zmij6.45 nsxjb646.99 nsyy24.63 nsdragonbox28.95 nsfmt36.84 nsuscale45.86 nsryu46.07 nsto_chars51.35 nsschubfach53.62 nsdouble-conversion87.43 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.95 ns)

Hover or click a method to highlight its series.