3 ms·
Not long ago I’ve benchmarked several implementations. The fastest itoa I’ve found was fmt::FormatInt class from there https://github.com/fmtlib/fmt https://git
by Const-me 9y ago
Not long ago I’ve benchmarked several implementations. The fastest itoa I’ve found was fmt::FormatInt class from there https://github.com/fmtlib/fmt https://github.com/fmtlib/fmt
Based on the article, I think fmtlib will be faster than what they did here.
- deleted 9y ago[deleted]
- Veedrac 9y agoFormatInt doesn't write out to a buffer and doesn't pad the output with zeros, so it's going to lose out nontrivially in actual use. I have tested some FormatInt-like code that does do those things; if I recall the results correctly, the article's is slightly faster with unpredictable sizes and significantly faster with predictable sizes.