Re:Floating-Point Printing and Parsing Can Be Simple and Fast
by magicalhippo on Friday January 23, 2026 @06:54PM
(#46739574)
What about reasonably fast but smallest code, for running on a microcontroller? Anything signifactly better in terms of compiled size (including lookups)?
[ Parent
| on HN ]
Re:Floating-Point Printing and Parsing Can Be Simple and Fast
by vitaut on Friday January 23, 2026 @10:24PM
(#46740760)
If you compress the table (see my earlier comment) and use plain Schubfach then you can get really small binary size and decent perf. IIRC Dragonbox with the compressed table was ~30% slower which is a reasonable price to pay and still faster than most algorithms including Ryu.
Re:Floating-Point Printing and Parsing Can Be Simple and Fast
by adgjlsfhk1 on Friday January 23, 2026 @10:28PM
(#46740783)
When 30% is only ~3-6 ns it definitely seems worthwhile.
Re:Floating-Point Printing and Parsing Can Be Simple and Fast
by vitaut on Saturday January 24, 2026 @10:49AM
(#46744564)
Note that ~3-6ns is on modern desktop CPUs where extra few kB matter less. On microcontrollers it will be larger in absolute terms but I would expect the relative difference to also be moderate.