r/cpp • u/aearphen {fmt} • Jul 20 '26
Żmij 1.1 released with fixed notation support, up to 38% faster double-to-string conversion, SIMD-optimized float formatting, a smaller binary footprint and more
41
Upvotes
View all comments
Show parent comment
6
u/jk-jeon Jul 20 '26
I think it's basically because our world isn't ideal. It just happens that people abuse text format a lot when binary clearly would have been preferable. It seems in many fields text formats are just standard for no reason or for questionable reasons or for reasons that made sense 3-4 decades ago but not so much these days. But if it's already an industry standard, then it's game over. Just follow the practice or you'll be hated by everyone else.
One such example: https://en.wikipedia.org/wiki/Wavefront_.obj_file
I mean, I don't get why it should be a text format. Is it even possible to edit a 3D model using a text editor when the model has 1000+ vertices and complicated geometry? But for whatever reason this seems to be a widely adapted industry standard. And apparently printing numbers was indeed a serious bottleneck:
https://aras-p.info/blog/2022/02/03/Speeding-up-Blender-.obj-export/
According to the post it turned out that the biggest cause was the locale nonsense which effectively killed parallelization, but the contribution from replacing the number conversion routine by a faster one was non-negligible too.