Binary -> decimal conversion is generally very slow. The best thing to do is to 
not do it at all if possible, but just stay in binary.

If external requirements really force you into ASCII and if you can use the 
head/tip of nim-devel then you can make your code much faster with 
`-d:nimPreviewFloatRoundtrip`. For me the time for prep vectors went from 0.278 
sec to 0.053 s or over 5x, while your whole program went from 0.315 sec to 
0.088 s.

In the new dragonbox/`-d:nimPreviewFloatRoundtrip` version, 35% of time still 
comes from all that string allocating & formatting, backing up my just don't do 
it at all advice, if that is possible. A similar cost compounds on the other 
side that has to parse your ASCII.

Reply via email to