mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-10-30 02:47:13 +08:00
PR #356 replaced the 3/5-character case-insensitive compare used by parse_infnan with SWAR helpers (fastfloat_strncasecmp3/5 plus a generic memcpy-based fastfloat_strncasecmp). That code only runs for "nan", "inf" and "infinity" inputs, so it cannot help ordinary parsing, but it grew the inlined inf/nan tail of the parser: on x86-64 (GCC 14 and clang 21) the per-commit benchmarks dropped by 1.5-2.5% because the extra dead code changed inlining decisions and register allocation on the hot path (+7 instructions/float on canada.txt). Go back to the plain loop, which the compiler unrolls for the constant lengths 3 and 5, and drop the now-unused generic SWAR function. The `actual < 256` guard of the original is unnecessary: OR-ing 0x20 into a value can only equal an ASCII lowercase letter when the value is that letter or its uppercase form, so the plain OR is exact for every character type. |
||
|---|---|---|
| .. | ||
| fast_float | ||