mirror of
https://github.com/fmtlib/fmt.git
synced 2026-07-31 00:36:58 +08:00
count_digits and do_format_decimal divided the full 128-bit value by a constant in a loop. Compilers do not strength-reduce 128-bit division, so each iteration became a slow __udivti3 library call (~27 per number). Reduce the value to 64-bit chunks by dividing by 10^19 (at most twice) and reuse the fast 64-bit paths, giving a ~5x speedup on full-range values. |
||
|---|---|---|
| .. | ||
| fmt | ||