| Filename | /usr/lib/perl/5.10/Math/BigInt/FastCalc.pm |
| Statements | Executed 58 statements in 715µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 11.3ms | 12.1ms | Math::BigInt::FastCalc::BEGIN@8 |
| 1 | 1 | 1 | 139µs | 146µs | Math::BigInt::FastCalc::BEGIN@25 |
| 1 | 1 | 1 | 68µs | 68µs | Math::BigInt::FastCalc::BEGIN@3 |
| 1 | 1 | 1 | 64µs | 64µs | Math::BigInt::FastCalc::bootstrap (xsub) |
| 1 | 1 | 1 | 17µs | 111µs | Math::BigInt::FastCalc::BEGIN@10 |
| 1 | 1 | 1 | 12µs | 12µs | Math::BigInt::FastCalc::BEGIN@7 |
| 1 | 1 | 1 | 12µs | 30µs | Math::BigInt::FastCalc::BEGIN@42 |
| 1 | 1 | 1 | 11µs | 11µs | Math::BigInt::FastCalc::_zero (xsub) |
| 1 | 1 | 1 | 11µs | 16µs | Math::BigInt::FastCalc::BEGIN@4 |
| 1 | 1 | 1 | 8µs | 14µs | Math::BigInt::FastCalc::import |
| 1 | 1 | 1 | 8µs | 8µs | Math::BigInt::FastCalc::_new (xsub) |
| 1 | 1 | 1 | 6µs | 6µs | Math::BigInt::FastCalc::_set_XS_BASE (xsub) |
| 1 | 1 | 1 | 900ns | 900ns | Math::BigInt::FastCalc::api_version (xsub) |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Math::BigInt::FastCalc; | ||||
| 2 | |||||
| 3 | 3 | 84µs | 1 | 68µs | # spent 68µs within Math::BigInt::FastCalc::BEGIN@3 which was called:
# once (68µs+0s) by Math::BigInt::BEGIN@1 at line 3 # spent 68µs making 1 call to Math::BigInt::FastCalc::BEGIN@3 |
| 4 | 3 | 27µs | 2 | 21µs | # spent 16µs (11+5) within Math::BigInt::FastCalc::BEGIN@4 which was called:
# once (11µs+5µs) by Math::BigInt::BEGIN@1 at line 4 # spent 16µs making 1 call to Math::BigInt::FastCalc::BEGIN@4
# spent 5µs making 1 call to strict::import |
| 5 | # use warnings; # dont use warnings for older Perls | ||||
| 6 | |||||
| 7 | 3 | 31µs | 1 | 12µs | # spent 12µs within Math::BigInt::FastCalc::BEGIN@7 which was called:
# once (12µs+0s) by Math::BigInt::BEGIN@1 at line 7 # spent 12µs making 1 call to Math::BigInt::FastCalc::BEGIN@7 |
| 8 | 3 | 141µs | 2 | 12.1ms | # spent 12.1ms (11.3+828µs) within Math::BigInt::FastCalc::BEGIN@8 which was called:
# once (11.3ms+828µs) by Math::BigInt::BEGIN@1 at line 8 # spent 12.1ms making 1 call to Math::BigInt::FastCalc::BEGIN@8
# spent 2µs making 1 call to Math::BigInt::Calc::import |
| 9 | |||||
| 10 | 3 | 111µs | 2 | 205µs | # spent 111µs (17+94) within Math::BigInt::FastCalc::BEGIN@10 which was called:
# once (17µs+94µs) by Math::BigInt::BEGIN@1 at line 10 # spent 111µs making 1 call to Math::BigInt::FastCalc::BEGIN@10
# spent 94µs making 1 call to vars::import |
| 11 | |||||
| 12 | 1 | 12µs | @ISA = qw(DynaLoader); | ||
| 13 | |||||
| 14 | 1 | 700ns | $VERSION = '0.19'; | ||
| 15 | |||||
| 16 | 1 | 9µs | 1 | 472µs | bootstrap Math::BigInt::FastCalc $VERSION; # spent 472µs making 1 call to DynaLoader::bootstrap |
| 17 | |||||
| 18 | ############################################################################## | ||||
| 19 | # global constants, flags and accessory | ||||
| 20 | |||||
| 21 | # announce that we are compatible with MBI v1.70 and up | ||||
| 22 | sub api_version () { 1; } | ||||
| 23 | |||||
| 24 | BEGIN | ||||
| 25 | # spent 146µs (139+7) within Math::BigInt::FastCalc::BEGIN@25 which was called:
# once (139µs+7µs) by Math::BigInt::BEGIN@1 at line 51 | ||||
| 26 | # use Calc to override the methods that we do not provide in XS | ||||
| 27 | |||||
| 28 | 3 | 11µs | for my $method (qw/ | ||
| 29 | str | ||||
| 30 | add sub mul div | ||||
| 31 | rsft lsft | ||||
| 32 | mod modpow modinv | ||||
| 33 | gcd | ||||
| 34 | pow root sqrt log_int fac nok | ||||
| 35 | digit check | ||||
| 36 | from_hex from_bin from_oct as_hex as_bin as_oct | ||||
| 37 | zeros base_len | ||||
| 38 | xor or and | ||||
| 39 | alen 1ex | ||||
| 40 | /) | ||||
| 41 | { | ||||
| 42 | 3 | 79µs | 2 | 48µs | # spent 30µs (12+18) within Math::BigInt::FastCalc::BEGIN@42 which was called:
# once (12µs+18µs) by Math::BigInt::BEGIN@1 at line 42 # spent 30µs making 1 call to Math::BigInt::FastCalc::BEGIN@42
# spent 18µs making 1 call to strict::unimport |
| 43 | 32 | 121µs | *{'Math::BigInt::FastCalc::_' . $method} = \&{'Math::BigInt::Calc::_' . $method}; | ||
| 44 | } | ||||
| 45 | my ($AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL); | ||||
| 46 | |||||
| 47 | # store BASE_LEN and BASE to later pass it to XS code | ||||
| 48 | 1 | 7µs | ($BASE_LEN, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL, $BASE) = # spent 7µs making 1 call to Math::BigInt::Calc::_base_len | ||
| 49 | Math::BigInt::Calc::_base_len(); | ||||
| 50 | |||||
| 51 | 1 | 67µs | 1 | 146µs | } # spent 146µs making 1 call to Math::BigInt::FastCalc::BEGIN@25 |
| 52 | |||||
| 53 | sub import | ||||
| 54 | # spent 14µs (8+6) within Math::BigInt::FastCalc::import which was called:
# once (8µs+6µs) by Math::BigInt::BEGIN@1 at line 1 of (eval 1006)[Math/BigInt.pm:2666] | ||||
| 55 | 1 | 15µs | 1 | 6µs | _set_XS_BASE($BASE, $BASE_LEN); # spent 6µs making 1 call to Math::BigInt::FastCalc::_set_XS_BASE |
| 56 | } | ||||
| 57 | |||||
| 58 | ############################################################################## | ||||
| 59 | ############################################################################## | ||||
| 60 | |||||
| 61 | 1 | 7µs | 1; | ||
| 62 | __END__ | ||||
# spent 8µs within Math::BigInt::FastCalc::_new which was called:
# once (8µs+0s) by Math::BigInt::new at line 639 of Math/BigInt.pm | |||||
# spent 6µs within Math::BigInt::FastCalc::_set_XS_BASE which was called:
# once (6µs+0s) by Math::BigInt::FastCalc::import at line 55 | |||||
# spent 11µs within Math::BigInt::FastCalc::_zero which was called:
# once (11µs+0s) by Math::BigInt::new at line 586 of Math/BigInt.pm | |||||
# spent 900ns within Math::BigInt::FastCalc::api_version which was called:
# once (900ns+0s) by Math::BigInt::import at line 2672 of Math/BigInt.pm | |||||
# spent 64µs within Math::BigInt::FastCalc::bootstrap which was called:
# once (64µs+0s) by DynaLoader::bootstrap at line 215 of DynaLoader.pm |