Filename | /Users/ether/perl5/perlbrew/perls/36.0/lib/5.36.0/version.pm |
Statements | Executed 21 statements in 2.31ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 926µs | 953µs | BEGIN@6 | version::
31 | 2 | 1 | 59µs | 59µs | new (xsub) | version::
1 | 1 | 1 | 17µs | 17µs | BEGIN@4 | version::
1 | 1 | 1 | 4µs | 4µs | (bool (xsub) | version::
1 | 1 | 1 | 4µs | 10µs | BEGIN@27 | version::
1 | 1 | 1 | 3µs | 3µs | (cmp (xsub) | version::
1 | 1 | 1 | 3µs | 5µs | BEGIN@5 | version::
0 | 0 | 0 | 0s | 0s | __ANON__[:53] | version::
0 | 0 | 0 | 0s | 0s | __ANON__[:59] | version::
0 | 0 | 0 | 0s | 0s | import | version::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | #!perl -w | ||||
2 | package version; | ||||
3 | |||||
4 | 2 | 31µs | 1 | 17µs | # spent 17µs within version::BEGIN@4 which was called:
# once (17µs+0s) by experimental::BEGIN@5 at line 4 # spent 17µs making 1 call to version::BEGIN@4 |
5 | 2 | 13µs | 2 | 7µs | # spent 5µs (3+2) within version::BEGIN@5 which was called:
# once (3µs+2µs) by experimental::BEGIN@5 at line 5 # spent 5µs making 1 call to version::BEGIN@5
# spent 2µs making 1 call to strict::import |
6 | 2 | 1.01ms | 2 | 980µs | # spent 953µs (926+27) within version::BEGIN@6 which was called:
# once (926µs+27µs) by experimental::BEGIN@5 at line 6 # spent 953µs making 1 call to version::BEGIN@6
# spent 27µs making 1 call to warnings::register::import |
7 | 1 | 2µs | 1 | 5µs | if ($] >= 5.015) { # spent 5µs making 1 call to warnings::register_categories |
8 | warnings::register_categories(qw/version/); | ||||
9 | } | ||||
10 | |||||
11 | 1 | 0s | our $VERSION = 0.9929; | ||
12 | 1 | 0s | our $CLASS = 'version'; | ||
13 | our (@ISA, $STRICT, $LAX); | ||||
14 | |||||
15 | # avoid using Exporter | ||||
16 | 1 | 1.01ms | require version::regex; | ||
17 | 1 | 1µs | *version::is_lax = \&version::regex::is_lax; | ||
18 | 1 | 0s | *version::is_strict = \&version::regex::is_strict; | ||
19 | 1 | 1µs | *LAX = \$version::regex::LAX; | ||
20 | 1 | 0s | *LAX_DECIMAL_VERSION = \$version::regex::LAX_DECIMAL_VERSION; | ||
21 | 1 | 0s | *LAX_DOTTED_DECIMAL_VERSION = \$version::regex::LAX_DOTTED_DECIMAL_VERSION; | ||
22 | 1 | 1µs | *STRICT = \$version::regex::STRICT; | ||
23 | 1 | 0s | *STRICT_DECIMAL_VERSION = \$version::regex::STRICT_DECIMAL_VERSION; | ||
24 | 1 | 0s | *STRICT_DOTTED_DECIMAL_VERSION = \$version::regex::STRICT_DOTTED_DECIMAL_VERSION; | ||
25 | |||||
26 | sub import { | ||||
27 | 2 | 240µs | 2 | 16µs | # spent 10µs (4+6) within version::BEGIN@27 which was called:
# once (4µs+6µs) by experimental::BEGIN@5 at line 27 # spent 10µs making 1 call to version::BEGIN@27
# spent 6µs making 1 call to strict::unimport |
28 | my ($class) = shift; | ||||
29 | |||||
30 | # Set up any derived class | ||||
31 | unless ($class eq $CLASS) { | ||||
32 | local $^W; | ||||
33 | *{$class.'::declare'} = \&{$CLASS.'::declare'}; | ||||
34 | *{$class.'::qv'} = \&{$CLASS.'::qv'}; | ||||
35 | } | ||||
36 | |||||
37 | my %args; | ||||
38 | if (@_) { # any remaining terms are arguments | ||||
39 | map { $args{$_} = 1 } @_ | ||||
40 | } | ||||
41 | else { # no parameters at all on use line | ||||
42 | %args = | ||||
43 | ( | ||||
44 | qv => 1, | ||||
45 | 'UNIVERSAL::VERSION' => 1, | ||||
46 | ); | ||||
47 | } | ||||
48 | |||||
49 | my $callpkg = caller(); | ||||
50 | |||||
51 | if (exists($args{declare})) { | ||||
52 | *{$callpkg.'::declare'} = | ||||
53 | sub {return $class->declare(shift) } | ||||
54 | unless defined(&{$callpkg.'::declare'}); | ||||
55 | } | ||||
56 | |||||
57 | if (exists($args{qv})) { | ||||
58 | *{$callpkg.'::qv'} = | ||||
59 | sub {return $class->qv(shift) } | ||||
60 | unless defined(&{$callpkg.'::qv'}); | ||||
61 | } | ||||
62 | |||||
63 | if (exists($args{'UNIVERSAL::VERSION'})) { | ||||
64 | local $^W; | ||||
65 | *UNIVERSAL::VERSION | ||||
66 | = \&{$CLASS.'::_VERSION'}; | ||||
67 | } | ||||
68 | |||||
69 | if (exists($args{'VERSION'})) { | ||||
70 | *{$callpkg.'::VERSION'} = \&{$CLASS.'::_VERSION'}; | ||||
71 | } | ||||
72 | |||||
73 | if (exists($args{'is_strict'})) { | ||||
74 | *{$callpkg.'::is_strict'} = \&{$CLASS.'::is_strict'} | ||||
75 | unless defined(&{$callpkg.'::is_strict'}); | ||||
76 | } | ||||
77 | |||||
78 | if (exists($args{'is_lax'})) { | ||||
79 | *{$callpkg.'::is_lax'} = \&{$CLASS.'::is_lax'} | ||||
80 | unless defined(&{$callpkg.'::is_lax'}); | ||||
81 | } | ||||
82 | } | ||||
83 | |||||
84 | |||||
85 | 1 | 4µs | 1; | ||
# spent 4µs within version::(bool which was called:
# once (4µs+0s) by Moo::_Utils::BEGIN@35 at line 59 of Config.pm | |||||
# spent 3µs within version::(cmp which was called:
# once (3µs+0s) by Moo::_Utils::BEGIN@35 at line 62 of Config.pm | |||||
# spent 59µs within version::new which was called 31 times, avg 2µs/call:
# 28 times (56µs+0s) by OpenAPI::Modern::BEGIN@13 at line 56 of experimental.pm, avg 2µs/call
# 3 times (3µs+0s) by OpenAPI::Modern::BEGIN@13 at line 57 of experimental.pm, avg 1µs/call |