[libmath-prime-util-perl] 40/59: Recommend Math::BigInt::GMP and try to use in tests

Partha P. Mukherjee ppm-guest at moszumanska.debian.org
Thu May 21 18:44:59 UTC 2015


This is an automated email from the git hooks/post-receive script.

ppm-guest pushed a commit to annotated tag v0.10
in repository libmath-prime-util-perl.

commit d65f8728210475f80f8ac411bb882534e61149c1
Author: Dana Jacobsen <dana at acm.org>
Date:   Sun Jul 8 16:23:00 2012 -0600

    Recommend Math::BigInt::GMP and try to use in tests
---
 lib/Math/Prime/Util.pm | 8 ++++++--
 t/81-bignum.t          | 3 ++-
 2 files changed, 8 insertions(+), 3 deletions(-)

diff --git a/lib/Math/Prime/Util.pm b/lib/Math/Prime/Util.pm
index 7057bbf..672931a 100644
--- a/lib/Math/Prime/Util.pm
+++ b/lib/Math/Prime/Util.pm
@@ -1267,8 +1267,12 @@ will turn off bigint support for those functions.  Those functions will then
 go directly to the XS versions, which will speed up very small inputs a B<lot>.
 
 Having run these functions on many versions of Perl, if you're using anything
-older than Perl 5.14, I would recommend you upgrade if you want bigint support.
-There are a lot of brittle behaviors on 5.12.4 and earlier.
+older than Perl 5.14, I would recommend you upgrade if you are using bigints
+a lot.  There are some brittle behaviors on 5.12.4 and earlier.
+
+I also recommend installing L<Math::BigInt::GMP> and writing
+C< use bigint try => 'GMP'> to have bigint see if it can use GMP.  Large
+modular exponentiation is much, much faster using the GMP or Pari backends.
 
 
 
diff --git a/t/81-bignum.t b/t/81-bignum.t
index bc71f0d..75d7f7e 100644
--- a/t/81-bignum.t
+++ b/t/81-bignum.t
@@ -69,7 +69,8 @@ plan tests => 0 +
               12 +  # random primes
               0;
 
-use bigint;     #  <--------------- We're testing large numbers here:  > 2^64
+# Using GMP makes these tests run about 2x faster on my machine
+use bigint try => 'GMP';   #  <--------------- large numbers ahead!  > 2^64
 
 use Math::Prime::Util qw/
   is_prob_prime

-- 
Alioth's /usr/local/bin/git-commit-notice on /srv/git.debian.org/git/pkg-perl/packages/libmath-prime-util-perl.git



More information about the Pkg-perl-cvs-commits mailing list