What does HackerNews think of fast_float?
Fast and exact implementation of the C++ from_chars functions for float and double types: 4x faster than strtod
Of course it's possible that the author wanted to support compilers released before 2018 when that code was written in which case not even integer from_chars would be available.
And implicit locales should just die. It's sad that even newer functionality like std::format relies on them. Sadder that if it didn't then you'd probably have compiler developers pulling shit like GCC/libstdc++ does for std::from_chars [0] which defeats the entire point of that function but hey, at least they can mark that as implemented. Not like there are suitably licensed implementations of the functionality [1] available that they could use instead if they don't want to implement float parsing themselves.
[0] https://github.com/gcc-mirror/gcc/blob/master/libstdc++-v3/s...
Lemire's really has made a huge contribution to computer science
* https://github.com/fastfloat/fast_float <-- for fast float/double conversion
* from_chars() for fast integer conversion (though I benchmarked a few that were slightly faster but probably less robust), see https://en.cppreference.com/w/cpp/utility/from_chars
* https://github.com/simdjson/simdjson <-- apparently the fastest JSON library
It's hard to program normal anymore, for every little thing I ask myself "but I want it faster!" TypeScript was so much easier, other than O(n) and friends, I never cared xD
Coincidentally, I've participated in this as well recently by implementing the algorithm in Rust (fast-float crate, see [4] for the source and benchmarks). It is insanely fast (easily over 1GB/s on an m1 machine) and beats all of the existing float parsers I'm aware of by a large margin, at least on the datasets we've tested it on.
[1] https://lemire.me/blog/2021/01/29/number-parsing-at-a-gigaby...
[2] https://arxiv.org/pdf/2101.11408.pdf
https://lemire.me/blog/2020/03/10/fast-float-parsing-in-prac...
He followed up in a comment: "RapidJSON has at least two fast-parsing mode. The fast mode, which I think is what you refer to, is indeed quite fast, but it can be off by one ULP, so it is not standard compliant."
The Github README for this new project says, "The fast_float library provides a performance similar to that of the fast_double_parser library."
https://github.com/fastfloat/fast_float
However, the benchmarks show a significant improvement relative to those in the fast_double_parser README:
https://github.com/lemire/fast_double_parser
I tried to run the benchmarks, but my CMake is apparently too old, and Homebrew barfed all over the living room rug when I tried to update it.