mirror of
https://github.com/nlohmann/json.git
synced 2026-10-02 20:50:32 +00:00
libc++'s std::from_chars for float and double is 1.3x to 2.8x slower per number than Apple's strtod_l, and it was tried before Clinger's fast path. With Apple clang in C++17 mode, parsing random doubles took 1.75x as long as on develop, short numbers such as 123.45 1.3x, and mesh.json 1.2x. Use libc++'s std::from_chars only where the C library has no strtod_l. On Apple platforms, floats are now converted by Clinger's fast path and strtod_l, which is 0.90x to 1.01x the time of develop. Signed-off-by: Niels Lohmann <mail@nlohmann.me>