mirror of
https://github.com/fastfloat/fast_float.git
synced 2026-07-31 00:36:39 +08:00
PR #369 gated the digit-separator/prefix feature on a compile-time has_separator flag and claimed the has_separator==false instantiation "compiles to exactly the same code as if the feature did not exist". Instruction-count measurement (benchmark i/f, deterministic +/- 0.0%) disproved this: routing the default path through the shared, restructured body cost GCC 14 ~1.5-2.3 i/f on short doubles, a reproducible regression on mesh/double (+0.77 i/f ASCII, +1.35 UTF-16) even as canada improved. Fix: the has_separator==false instantiation now delegates to parse_number_string_nosep, a verbatim copy of the original separator-free scanner, so the default path's codegen is byte-for-byte the pre-feature parser. The shared parse_number_string body becomes separator-only (the dead !has_separator branches are removed). The inaccurate doc comment is corrected. Measured vs pre-feature baseline (34164f5), instructions per float: canada/f64 ASCII 242.32 -> 238.87 (PR: 240.87) canada/f64 UTF16 251.05 -> 241.81 (PR: 245.79) mesh/f64 ASCII 107.69 -> 107.57 (PR: 108.46, +0.77 regression) mesh/f64 UTF16 110.10 -> 109.74 (PR: 111.45, +1.35 regression) All eight fastfloat rows now match or beat both the baseline and the PR; the mesh/double regression is eliminated. All 14 ctest suites pass. |
||
|---|---|---|
| .. | ||
| ascii_number.h | ||
| bigint.h | ||
| constexpr_feature_detect.h | ||
| decimal_to_binary.h | ||
| digit_comparison.h | ||
| fast_float.h | ||
| fast_table.h | ||
| float_common.h | ||
| parse_number.h | ||