mirror of
https://github.com/fmtlib/fmt.git
synced 2026-07-30 16:26:27 +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. |
||
|---|---|---|
| .. | ||
| args.h | ||
| base.h | ||
| chrono.h | ||
| color.h | ||
| compile.h | ||
| core.h | ||
| fmt-c.h | ||
| format-inl.h | ||
| format.h | ||
| os.h | ||
| ostream.h | ||
| printf.h | ||
| ranges.h | ||
| std.h | ||
| xchar.h | ||