finds.dev← search

// the find

lemire/fast_double_parser

★ 670 · C++ · Apache-2.0 · updated May 2025

Fast function to parse strings into double (binary64) floating-point values, enforces the RFC 7159 (JSON standard) grammar: 4x faster than strtod

A header-only C++ library that parses decimal strings to double-precision floats at ~660 MB/s — roughly 10x faster than strtod on real-world data. It enforces strict RFC 7159 (JSON) number grammar, so it's a drop-in for JSON parsers that need fast float parsing, not a general strtod replacement. The author explicitly recommends migrating to fast_float instead.

The performance numbers are credible and reproducible — the benchmark code is included and the methodology is published in a peer-reviewed paper. The algorithm proved itself by landing in LLVM libc++, Go's strconv, GCC 12, and WebKit, which is as good a validation as you can get. Header-only with C++11 means zero integration friction. The clusterfuzz setup shows someone actually cares about correctness under adversarial input, not just happy-path speed.

The library itself says to use fast_float instead — it's right there in the README in giant exclamation points. fast_double_parser only handles double (no float), requires null-or-delimiter termination (no begin/end pointer pair), and has no API for parsing into integral types. The fallback to platform strtod_l for mantissas longer than 19 digits means you're only getting the fast path for the common case, and the behavior on the slow path is platform-dependent.

View on GitHub →

// want more like this?

We dig through GitHub every week and send a few repos picked for what you actually care about — each with an honest take like this one.

Get finds in your inbox → Search again →