Converting a 64-bit integer to its decimal string representation is a mundane task that shows up everywhere: logging, JSON serialization, CSV output, debug prints, etc. In C++, you might use
std::to_chars, sprintf, or some library routine. How do these functions work? At a high level, they repeatedly divide by ten. Start with your integer k. Divide it by ten, use the remainder as the last digit (it is between 0 and 9 inclusively). You then add the code point value of the character 0 to get the ASCII digit. To go faster, you can divide by 100 and use a lookup table so that the value between 0 and 99 inclusively is mapped to a string. So far so good. Unfortunately, even with all these optimizations, this string generation may become a performance bottleneck. Can you do better? Let us assume that you have a recent AMD processor or an Intel…https://lemire.me/blog/2026/05/18/simd-accelerated-integer-to-string-conversion/
