Fastfloat – C++ library 4x faster than strtod
github.com
github.com
Interestingly RapidJSON is one of the few JSON libraries for C++ that has a "full precision" mode. Most don't even do str->double conversions precisely.
[0] https://github.com/Tencent/rapidjson/blob/master/include/rap...
The best I have heard is Boost::Spirit [0].
[0]: https://kholdstare.github.io/technical/2020/05/26/faster-int...
boost::lexical_cast is twice as fast for int -> string if the BOOST_LEXICAL_CAST_ASSUME_C_LOCALE macro is defined. The binary was also 55Kb smaller.
But Rapidjson's algo was faster still.
I tend to agree that occasions when sentinels are the better option are firmly in the minority. Although I'm a little uneasy saying that because it assumes we can construct a singular, meaningful solution space and enumerate occasions where one approach is preferable than the other. IME that's not a very profitable way to approach things. (I want to make a comment about the problematic, fuzzy concept of "string" in computer science and the dynamic of how people conceive of problem and solution spaces in various languages and domains, but that's a rabbit hole I won't be able to climb out of.)