user269334
user269334

Reputation: 569

What's the fastest implementation for bignum? (Java's bigInteger / Cython's int / gmpy / etc...)

Are there any benchmark on this???

(I tried googling for some results but found none...

and I couldn't test gmpy because gmplib wouldn't be installed on my laptop)

thank you!

Upvotes: 0

Views: 1438

Answers (1)

casevh
casevh

Reputation: 11394

First of all, I'm probably biased since I'm the maintainer of gmpy.

gmpy uses the GMP multiple-precision library and GMP is usually considered the fastest general purpose multiple-precision library. But when it's "fastest" depends on on the operation and the size of the values. When I compare the performance between Python longs and gmpy's mpz type, the crossover point is roughly between 20 and 50 digits. You'll probably get different results on your machine.

What exactly are you trying to do?

Upvotes: 2

Related Questions