Skip to content
Snippets Groups Projects
Commit af2ba9c8 authored by Herbert Valerio Riedel's avatar Herbert Valerio Riedel :man_dancing:
Browse files

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's avatarHerbert Valerio Riedel <hvr@gnu.org>
parent 8ed8ac58
No related branches found
No related tags found
No related merge requests found
Loading
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment