strconv/number.mbt:104 (and its duplicate internal/strconv/strconv_number.mbt:104) carries this TODO on the float-parsing hot path:
TODO: optimization chance. In the original Rust implementation, [they] try to parse 8 digits at a time [into a u64].
parse_digits currently accumulates digit-by-digit. The Eisel-Lemire reference implementation reads 8 bytes into a u64 and validates/converts them in a handful of arithmetic ops, which is a substantial constant-factor win for long mantissas.
Care needed around digit-count/overflow boundaries and the two copies of the code (strconv/ and internal/strconv/ must stay in sync — or better, be deduplicated as part of this work).
strconv/number.mbt:104(and its duplicateinternal/strconv/strconv_number.mbt:104) carries this TODO on the float-parsing hot path:parse_digitscurrently accumulates digit-by-digit. The Eisel-Lemire reference implementation reads 8 bytes into au64and validates/converts them in a handful of arithmetic ops, which is a substantial constant-factor win for long mantissas.Care needed around digit-count/overflow boundaries and the two copies of the code (
strconv/andinternal/strconv/must stay in sync — or better, be deduplicated as part of this work).