>… but that’s exactly how conversion to string works, so handrolling an algorithm would likely be around the same speed.
https://github.com/lattera/glibc/blob/master/stdio-common/_i...
It's all bit-shifts, bit-masks and a lot of other hacks to get the maximum performance out of the system you're compiling the code on.
Could I write something with better performance on my system? Yeah, after a week to run tests and write esoteric macros.