Wrap `gmpz_tdiv_{q,r,qr}_ui` to optimize `quot`/`rem`
This is useful as `quot`/`rem` are often used with small-int divisors,
like when computing the digits of an `Integer`. This optimization
reduces allocations in the following `nofib` benchmarks:
Program Size Allocs Runtime Elapsed TotalMem
-----------------------------------------------------------------
power +0.3% -0.8% -1.2% -1.2% +0.0%
primetest +0.3% -3.9% 0.07 0.07 +0.0%
rsa +0.3% -4.0% 0.02 0.02 +0.0%
symalg +0.2% -1.4% 0.01 0.01 +0.0%
This addresses #8647
Signed-off-by:
Herbert Valerio Riedel <hvr@gnu.org>
Loading
Please register or sign in to comment