[commit: packages/integer-gmp] master: Wrap `gmpz_tdiv_{q, r, qr}_ui` to optimize `quot`/`rem` (af2ba9c)
git at git.haskell.org
git at git.haskell.org
Wed Jan 8 23:26:30 UTC 2014
Repository : ssh://git@git.haskell.org/integer-gmp
On branch : master
Link : http://ghc.haskell.org/trac/ghc/changeset/af2ba9c81cf6a3223ccc74c5aa17de18138fd824/integer-gmp
>---------------------------------------------------------------
commit af2ba9c81cf6a3223ccc74c5aa17de18138fd824
Author: Herbert Valerio Riedel <hvr at gnu.org>
Date: Wed Jan 8 22:45:13 2014 +0100
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 at gnu.org>
>---------------------------------------------------------------
af2ba9c81cf6a3223ccc74c5aa17de18138fd824
GHC/Integer/GMP/Prim.hs | 17 +++++++++++++++++
GHC/Integer/Type.lhs | 28 +++++++++++++++++++++-------
cbits/gmp-wrappers.cmm | 33 +++++++++++++++++++++++++++++++++
3 files changed, 71 insertions(+), 7 deletions(-)
Diff suppressed because of size. To see it, use:
git diff-tree --root --patch-with-stat --no-color --find-copies-harder --ignore-space-at-eol --cc af2ba9c81cf6a3223ccc74c5aa17de18138fd824
More information about the ghc-commits
mailing list