dtoa-benchmark

apple-m1-pro_macos_clang17.0_03adc84

Time per double (lower is better)

MethodTime (ns)Speedup
zmij8.66
xjb6410.54
yy14.01
dragonbox20.53
fmt22.22
schubfach24.72
ryu36.81
to_chars42.81
double-conversion83.33
sprintf735.29
ostringstream871.43

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).

zmij8.66 nsxjb6410.54 nsyy14.01 nsdragonbox20.53 nsfmt22.22 nsschubfach24.72 nsryu36.81 nsto_chars42.81 nsdouble-conversion83.33 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.