Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

Isn't the biggest iostream bottleneck the forced sync with cstdio? You can turn that of at program start.


With that enabled it's comically slow, but even without the stdio syncing (and even operating on stringstreams) it's still much slower. For simple one-off formatting it's hard to notice, but once you write a parser for some engineering file formats (most of which are still ASCII) and have to read a few million floats here or there it becomes a really stark difference. For parsing floats specifically there are some implementations around which are optimized more, though some of the "fast and clever" ones are less accurate.




Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: