dtoa-benchmark

epyc-milan-processor_linux_gcc11.5_69644a9

Time per double (lower is better)

MethodTime (ns)Speedup
zmij19.19
xjb6419.27
yy26.96
dragonbox30.90
fmt40.10
schubfach44.44
ryu54.14
to_chars67.11
double-conversion95.71
sprintf563.02
ostringstream958.89

Click any row to use it as the speedup baseline.

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

zmij19.19 nsxjb6419.27 nsyy26.96 nsdragonbox30.90 nsfmt40.10 nsschubfach44.44 nsryu54.14 nsto_chars67.11 nsdouble-conversion95.71 ns

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

Time vs. digit count (log scale)

1234567891011121314151617510501005001,0000DigitsTime (ns)loop overhead (2.77 ns)

Hover or click a method to highlight its series.