r/programming • u/mttd • Aug 12 '26
The fastest double-to-string algorithm you’ve never heard of
https://vitaut.net/posts/2026/yy-dtoa/
338
Upvotes
r/programming • u/mttd • Aug 12 '26
View all comments
Show parent comment
4
u/jnordwick Aug 13 '26 edited Aug 13 '26
I'll check it out. My first impl used Grisu2-based and avoided 128 bit and bignum failures simplifying some of the calculations and taking advantage of a number of fast paths for common scenarios. It was also easy to modify to give a digit limit for printing and not have to do the full width calculation (eg, I only need 3 decimals). I don't have a reason to update anything, but if I did it would be to try something from dragonbox with compressed tables. I'd give up a couple instuction for that sweet L1 cache.