Re:strcpy: A niche function you don't need
by josefx on Saturday July 31, 2021 @04:11AM
(#28016349)
Isn't the biggest iostream bottleneck the forced sync with cstdio? You can turn that of at program start.
[ Parent
| on HN ]
Re:strcpy: A niche function you don't need
by formerly_proven on Saturday July 31, 2021 @05:51AM
(#28016768)
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.