[Request for comments] Potential room for speedup when calculating divmod() of bases with many trailing 0 bits (in binary)

Marco Bodrato bodrato at mail.dm.unipi.it
Tue Sep 22 21:30:42 UTC 2020


Ciao,

Il 2020-09-22 14:18 Shlomi Fish ha scritto:
> linking with that gnump made wo-shift faster than with-shift with the
> original gnump:

You mean that your implementation of the trick was not needed any more, 
right?

> It is still slower than pypy3 running the python code:

Well, maybe there is too much overhead in the benchmark you prepared. I 
glanced at it and saw a lot of _init/_clear, assert, a new type, a 
scratch_type... just for computing some divisions?
Or maybe the numbers are not big enough to let GMP really enter in his 
range of usefulness... (if most of the test involves e.g. 32-bits 
numbers, then GMP may be far slower than some other implementations).

You should try to write more concise benchmarks (someone also asked for 
more concise e-mails :-)

Ĝis,
m


More information about the gmp-discuss mailing list