mpz_powm_ui(...) is MUCH slower than mpz_powm(...)

Zimmermann Paul Paul.Zimmermann at loria.fr
Tue Oct 2 10:32:38 CEST 2012


I confirm mpz_powm_ui is much slower than mpz_powm:

tarte% ./benchmark-powm 100000000
pow2mod_ui ...
30011
46935641
1408585522051
Time for pow2mod_ui: 135.41 sec., 100000000 (1e+08) tests, 7.38e+05 tests/sec.

pow2mod_mpz ...
30011
46935641
1408585522051
Time for pow2mod_mpz: 56.67 sec., 100000000 (1e+08) tests, 1.76e+06 tests/sec.

This should be fixed.

Paul Zimmermann


More information about the gmp-bugs mailing list