GMP compared to JAVA

Paul Zimmermann Paul.Zimmermann at
Fri Dec 21 10:46:07 CET 2007

> I did a aplication with GMP and other same in JAVA.
> This aplication calculates the value of the operation a^b mod m, for
> a, b and m randomical numbers of n bits, n in interval [5, 25000).
> [...]
> For the result in C with n = 10005 bits the time was 2800 ms (a example).
> For the result in JAVA with n = 10005 bits the time was 10 ms (a example).
> Why this difference?

I see three possible explanations:

(a) JAVA is much more efficient than GMP
(b) your computer is very efficient for JAVA applications
(c) your JAVA exponent (q) has much less than 10005 bits

Paul Zimmermann

More information about the gmp-discuss mailing list