-
Notifications
You must be signed in to change notification settings - Fork 4
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
import Math-BigInt-GMP 1.16 from CPAN
git-cpan-module: Math-BigInt-GMP git-cpan-version: 1.16 git-cpan-authorid: TELS git-cpan-file: authors/id/T/TE/TELS/math/Math-BigInt-GMP-1.16.tar.gz
- Loading branch information
Showing
12 changed files
with
167 additions
and
104 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,12 +1,11 @@ | ||
# http://module-build.sourceforge.net/META-spec.html | ||
#XXXXXXX This is a prototype!!! It will change in the future!!! XXXXX# | ||
name: Math-BigInt-GMP | ||
version: 1.15 | ||
--- #YAML:1.0 | ||
name: Math-BigInt-GMP | ||
version: 1.16 | ||
version_from: lib/Math/BigInt/GMP.pm | ||
installdirs: site | ||
requires: | ||
Math::BigFloat: 1.47 | ||
Math::BigInt: 1.73 | ||
|
||
license: perl | ||
distribution_type: module | ||
generated_by: ExtUtils::MakeMaker version 6.17 | ||
generated_by: Math-BigInt-GMP version 1.16 | ||
installdirs: site | ||
requires: | ||
Math::BigFloat: 1.47 | ||
Math::BigInt: 1.73 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,28 +1,18 @@ | ||
|
||
Changes between the last and this version: | ||
|
||
v1.15: | ||
* some small cleanups in the Perl code | ||
* changed "class" to "Class" to avoid the reserved keyword for MS compiler | ||
* do not pull unused parameter "Class" from stack - avoid warnings when | ||
compiling - that makes the .so a tad smaller and should make it ever so | ||
slightly faster, too | ||
* put _sub() into XS for more speed and smaller memory footprint | ||
* testsuite from MBI v1.73 | ||
v1.16: | ||
* fixed a leak in _div() and simplified it (Thanx Tassilo v. Parseval) | ||
* moved the _div() code to XS to make it a bit faster | ||
* put leak.pl and leaktest into MANIFEST for later checking | ||
|
||
############################################################################# | ||
|
||
Benchmarking Math::BigInt sub (e.g. what an actual user would see): | ||
|
||
Math::BigInt v1.73, Math::BigInt::GMP v1.14: | ||
|
||
221 - 444: 5s (5.23 usr + 0.02 sys = 5.25 CPU) @ 15603/s (n=81919) | ||
444 - 221: 6s (5.21 usr + 0.02 sys = 5.23 CPU) @ 16968/s (n=88744) | ||
|
||
Math::BigInt v1.73, Math::BigInt::GMP v1.15: | ||
v1.15: | ||
221 / 444: 5 wallclock secs ( 5.20 usr + 0.01 sys = 5.21 CPU) @ 18940/s (n=98679) | ||
444 / 221: 6 wallclock secs ( 5.20 usr + 0.01 sys = 5.21 CPU) @ 19108/s (n=99555) | ||
|
||
Benchmark: running 221 - 444, 444 - 221 for at least 5 CPU seconds... | ||
221 - 444: 5s (5.25 usr + 0.02 sys = 5.27 CPU) @ 18031/s (n=95024) +15% | ||
444 - 221: 5s (5.15 usr + 0.01 sys = 5.16 CPU) @ 18080/s (n=93297) + 6% | ||
v1.16: | ||
221 / 444: 6 wallclock secs ( 5.24 usr + 0.01 sys = 5.25 CPU) @ 20957/s (n=110026) | ||
444 / 221: 5 wallclock secs ( 5.28 usr + 0.00 sys = 5.28 CPU) @ 21231/s (n=112102) | ||
|
||
############################################################################# |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
This directory contains scripts that are used by the developers. | ||
|
||
They are not necessarily usefull for users :) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,41 @@ | ||
#!/usr/bin/perl -w | ||
|
||
use strict; | ||
use lib 'lib'; | ||
use lib 'blib/arch'; | ||
use Math::BigInt lib => 'GMP'; | ||
use Devel::Leak; | ||
|
||
my $x = Math::BigInt->new(44); | ||
my $y = Math::BigInt->new(21); | ||
|
||
require Scalar::Util; # otherwise the first sub would do this | ||
|
||
my $xg = Math::BigInt::GMP->_new("44"); | ||
my $yg = Math::BigInt::GMP->_new("21"); | ||
|
||
for my $do ( | ||
[ sub { $xg = Math::BigInt::GMP->_div($xg,$yg); 1; }, 'divide direct' ], | ||
[ sub { my $z = $x / $y; 1; }, 'divide' ], | ||
[ sub { my $z = $x - $y; 1; }, 'subtract' ], | ||
[ sub { my $z = $x + $y; 1; }, 'add' ], | ||
[ sub { my $z = $x % $y; 1; }, 'mod' ], | ||
[ sub { my $z = $x ** $y; 1; }, 'pow' ], | ||
[ sub { my $z = $x ^ $y; 1; }, 'xor' ], | ||
[ sub { my $z = $x | $y; 1; }, 'ior' ], | ||
[ sub { my $z = $x & $y; 1; }, 'and' ], | ||
[ sub { my $z = $x; $z -= $y; 1; }, '-=' ], | ||
[ sub { my $z = $x; $z += $y; 1; }, '+=' ], | ||
[ sub { my $z = $x; $z %= $y; 1; }, '%=' ], | ||
[ sub { my $z = $x; $z /= $y; 1; }, '/=' ], | ||
[ sub { my ($q,$r) = $x->copy()->bdiv($y); 1; }, '(q,r) = x / y' ], | ||
) | ||
{ | ||
my $handle; | ||
my $count = Devel::Leak::NoteSV($handle); | ||
for (1..10) { &{$do->[0]}; } | ||
print "$do->[1] leaked ", Devel::Leak::CheckSV($handle) - $count, " things\n"; | ||
} | ||
|
||
exit; | ||
|
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,4 @@ | ||
#!/bin/sh | ||
|
||
valgrind --leak-check=yes perl "-MExtUtils::Command::MM" "-e" "test_harness(0, 'blib/lib', 'blib/arch')" t/*.t | ||
|
Oops, something went wrong.