top | item 41835896

(no title)

ftrobro | 1 year ago

Integers are simple to parse, but from_chars is a great improvement when parsing floats. It's more standardized on different platforms than the old solutions (no need to worry about the locale, for example whether to use comma or dot as decimals separator) but also has more reliable performance in different compilers. The most advanced approaches to parsing floats can be surprisingly much faster than intermediately advanced approaches. The library used by GCC since version 12 (and also used by Chrome) claims to be 4 - 10 times faster than old strtod implementations:

https://github.com/fastfloat/fast_float

For more historical context:

https://lemire.me/blog/2020/03/10/fast-float-parsing-in-prac...

discuss

order

No comments yet.