Home

Awesome

itoa - Fast integer to ascii / integer to string conversion

windows

Check it out vs. {fmt} on godbolt.org

Disclaimer: This is not a good way to benchmark. It's not very repeatable and google benchmark is compiled in debug, although fmt being mostly header is optimized and inlined well. The performance charts below are much more accurate.

-----------------------------------------------------
Benchmark           Time             CPU   Iterations
-----------------------------------------------------
BM_fmt           16.6 ns         10.5 ns     75504520
BM_jea           10.2 ns         4.13 ns    159688774

Click for interactive performance charts

The last column is uniform random length numbers from 1 to N digits - worst case for branch prediction based on number of digits

u32toa_chart

jeaiii vs. fmt