Filename | /usr/lib/perl/5.10/Math/BigInt/FastCalc.pm |
Statements | Executed 58 statements in 1.06ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 16.3ms | 17.5ms | BEGIN@8 | Math::BigInt::FastCalc::
1 | 1 | 1 | 180µs | 191µs | BEGIN@25 | Math::BigInt::FastCalc::
1 | 1 | 1 | 103µs | 103µs | BEGIN@3 | Math::BigInt::FastCalc::
1 | 1 | 1 | 61µs | 61µs | bootstrap (xsub) | Math::BigInt::FastCalc::
1 | 1 | 1 | 36µs | 43µs | BEGIN@7 | Math::BigInt::FastCalc::
1 | 1 | 1 | 21µs | 49µs | BEGIN@42 | Math::BigInt::FastCalc::
1 | 1 | 1 | 19µs | 28µs | BEGIN@4 | Math::BigInt::FastCalc::
1 | 1 | 1 | 19µs | 19µs | _new (xsub) | Math::BigInt::FastCalc::
1 | 1 | 1 | 18µs | 18µs | _zero (xsub) | Math::BigInt::FastCalc::
1 | 1 | 1 | 14µs | 107µs | BEGIN@10 | Math::BigInt::FastCalc::
1 | 1 | 1 | 9µs | 15µs | import | Math::BigInt::FastCalc::
1 | 1 | 1 | 6µs | 6µs | _set_XS_BASE (xsub) | Math::BigInt::FastCalc::
1 | 1 | 1 | 2µs | 2µs | api_version (xsub) | Math::BigInt::FastCalc::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Math::BigInt::FastCalc; | ||||
2 | |||||
3 | 3 | 130µs | 1 | 103µs | # spent 103µs within Math::BigInt::FastCalc::BEGIN@3 which was called:
# once (103µs+0s) by Math::BigInt::BEGIN@1 at line 3 # spent 103µs making 1 call to Math::BigInt::FastCalc::BEGIN@3 |
4 | 3 | 60µs | 2 | 36µs | # spent 28µs (19+8) within Math::BigInt::FastCalc::BEGIN@4 which was called:
# once (19µs+8µs) by Math::BigInt::BEGIN@1 at line 4 # spent 28µs making 1 call to Math::BigInt::FastCalc::BEGIN@4
# spent 8µs making 1 call to strict::import |
5 | # use warnings; # dont use warnings for older Perls | ||||
6 | |||||
7 | 3 | 74µs | 2 | 49µs | # spent 43µs (36+6) within Math::BigInt::FastCalc::BEGIN@7 which was called:
# once (36µs+6µs) by Math::BigInt::BEGIN@1 at line 7 # spent 43µs making 1 call to Math::BigInt::FastCalc::BEGIN@7
# spent 6µs making 1 call to UNIVERSAL::import |
8 | 3 | 171µs | 2 | 17.5ms | # spent 17.5ms (16.3+1.19) within Math::BigInt::FastCalc::BEGIN@8 which was called:
# once (16.3ms+1.19ms) by Math::BigInt::BEGIN@1 at line 8 # spent 17.5ms making 1 call to Math::BigInt::FastCalc::BEGIN@8
# spent 3µs making 1 call to Math::BigInt::Calc::import |
9 | |||||
10 | 3 | 135µs | 2 | 199µs | # spent 107µs (14+93) within Math::BigInt::FastCalc::BEGIN@10 which was called:
# once (14µs+93µs) by Math::BigInt::BEGIN@1 at line 10 # spent 107µs making 1 call to Math::BigInt::FastCalc::BEGIN@10
# spent 92µs making 1 call to vars::import |
11 | |||||
12 | 1 | 19µs | @ISA = qw(DynaLoader); | ||
13 | |||||
14 | 1 | 1µs | $VERSION = '0.19'; | ||
15 | |||||
16 | 1 | 16µs | 1 | 489µs | bootstrap Math::BigInt::FastCalc $VERSION; # spent 489µ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 191µs (180+11) within Math::BigInt::FastCalc::BEGIN@25 which was called:
# once (180µs+11µ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 | 18µ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 | 142µs | 2 | 78µs | # spent 49µs (21+29) within Math::BigInt::FastCalc::BEGIN@42 which was called:
# once (21µs+29µs) by Math::BigInt::BEGIN@1 at line 42 # spent 49µs making 1 call to Math::BigInt::FastCalc::BEGIN@42
# spent 29µs making 1 call to strict::unimport |
43 | 32 | 153µ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 | 11µs | ($BASE_LEN, $AND_BITS, $XOR_BITS, $OR_BITS, $BASE_LEN_SMALL, $MAX_VAL, $BASE) = # spent 11µs making 1 call to Math::BigInt::Calc::_base_len | ||
49 | Math::BigInt::Calc::_base_len(); | ||||
50 | |||||
51 | 1 | 119µs | 1 | 191µs | } # spent 191µs making 1 call to Math::BigInt::FastCalc::BEGIN@25 |
52 | |||||
53 | sub import | ||||
54 | # spent 15µs (9+6) within Math::BigInt::FastCalc::import which was called:
# once (9µs+6µs) by Math::BigInt::BEGIN@1 at line 1 of (eval 1023)[Math/BigInt.pm:2666] | ||||
55 | 1 | 18µ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 | 8µs | 1; | ||
62 | __END__ | ||||
# spent 19µs within Math::BigInt::FastCalc::_new which was called:
# once (19µ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 18µs within Math::BigInt::FastCalc::_zero which was called:
# once (18µs+0s) by Math::BigInt::new at line 586 of Math/BigInt.pm | |||||
# spent 2µs within Math::BigInt::FastCalc::api_version which was called:
# once (2µs+0s) by Math::BigInt::import at line 2672 of Math/BigInt.pm | |||||
# spent 61µs within Math::BigInt::FastCalc::bootstrap which was called:
# once (61µs+0s) by DynaLoader::bootstrap at line 215 of DynaLoader.pm |