Profile of version.pm

← Index
NYTProf Performance Profile «line view»
For -e
Run on Thu Jun 30 16:16:00 2016
Reported on Thu Jun 30 16:16:08 2016

Filename | /home/s1/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/x86_64-linux/version.pm
Statements | Executed 42 statements in 2.27ms

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 854µs | 1.13ms | version::::BEGIN@11version::BEGIN@11
1 | 1 | 1 | 458µs | 588µs | version::::BEGIN@6version::BEGIN@6
1 | 1 | 1 | 37µs | 37µs | version::::BEGIN@4version::BEGIN@4
1 | 1 | 1 | 13µs | 17µs | version::::BEGIN@5version::BEGIN@5
1 | 1 | 1 | 11µs | 27µs | version::::BEGIN@33version::BEGIN@33
1 | 1 | 1 | 10µs | 24µs | version::::BEGIN@52version::BEGIN@52
1 | 1 | 1 | 10µs | 23µs | version::::BEGIN@70version::BEGIN@70
0 | 0 | 0 | 0s | 0s | version::::__ANON__[:102]version::__ANON__[:102]
0 | 0 | 0 | 0s | 0s | version::::__ANON__[:96]version::__ANON__[:96]
0 | 0 | 0 | 0s | 0s | version::::importversion::import

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | #!perl -w
2 |  |  |  |  | package version;
3 |  |  |  |  |
4 | 2 | 76µs | 1 | 37µs | # spent 37µs within version::BEGIN@4 which was called: # once (37µs+0s) by experimental::BEGIN@5 at line 4 use 5.006002; # spent 37µs making 1 call to version::BEGIN@4
5 | 2 | 36µs | 2 | 22µs | # spent 17µs (13+4) within version::BEGIN@5 which was called: # once (13µs+4µs) by experimental::BEGIN@5 at line 5 use strict; # spent 17µs making 1 call to version::BEGIN@5 # spent 4µs making 1 call to strict::import
6 | 2 | 513µs | 2 | 717µs | # spent 588µs (458+129) within version::BEGIN@6 which was called: # once (458µs+129µs) by experimental::BEGIN@5 at line 6 use warnings::register; # spent 588µs making 1 call to version::BEGIN@6 # spent 130µs making 1 call to warnings::register::import
7 | 1 | 4µs | 1 | 7µs | if ($] >= 5.015) { # spent 7µs making 1 call to warnings::register_categories
8 |  |  |  |  | warnings::register_categories(qw/version/);
9 |  |  |  |  | }
10 |  |  |  |  |
11 | 2 | 499µs | 2 | 1.24ms | # spent 1.13ms (854µs+272µs) within version::BEGIN@11 which was called: # once (854µs+272µs) by experimental::BEGIN@5 at line 11 use vars qw(@ISA $VERSION $CLASS $STRICT $LAX *declare *qv); # spent 1.13ms making 1 call to version::BEGIN@11 # spent 111µs making 1 call to vars::import
12 |  |  |  |  |
13 | 1 | 300ns |  |  | $VERSION = 0.9916;
14 | 1 | 300ns |  |  | $CLASS = 'version';
15 |  |  |  |  |
16 |  |  |  |  | # !!!!Delete this next block completely when adding to Perl core!!!!
17 |  |  |  |  | {
18 | 2 | 4µs |  |  | local $SIG{'__DIE__'};
19 | 1 | 62µs |  |  | eval "use version::vxs $VERSION"; # spent 217µs executing statements in string eval # includes 415µs spent executing 1 call to 1 sub defined therein.
20 | 1 | 3µs |  |  | if ( $@ ) { # don't have the XS version installed
21 |  |  |  |  | eval "use version::vpp $VERSION"; # don't tempt fate
22 |  |  |  |  | die "$@" if ( $@ );
23 |  |  |  |  | push @ISA, "version::vpp";
24 |  |  |  |  | local $^W;
25 |  |  |  |  | *version::qv = \&version::vpp::qv;
26 |  |  |  |  | *version::declare = \&version::vpp::declare;
27 |  |  |  |  | *version::_VERSION = \&version::vpp::_VERSION;
28 |  |  |  |  | *version::vcmp = \&version::vpp::vcmp;
29 |  |  |  |  | *version::new = \&version::vpp::new;
30 |  |  |  |  | *version::numify = \&version::vpp::numify;
31 |  |  |  |  | *version::normal = \&version::vpp::normal;
32 |  |  |  |  | if ($] >= 5.009000) {
33 | 2 | 186µs | 2 | 42µs | # spent 27µs (11+16) within version::BEGIN@33 which was called: # once (11µs+16µs) by experimental::BEGIN@5 at line 33 no strict 'refs'; # spent 27µs making 1 call to version::BEGIN@33 # spent 16µs making 1 call to strict::unimport
34 |  |  |  |  | *version::stringify = \&version::vpp::stringify;
35 |  |  |  |  | *{'version::(""'} = \&version::vpp::stringify;
36 |  |  |  |  | *{'version::(<=>'} = \&version::vpp::vcmp;
37 |  |  |  |  | *{'version::(cmp'} = \&version::vpp::vcmp;
38 |  |  |  |  | *version::parse = \&version::vpp::parse;
39 |  |  |  |  | }
40 |  |  |  |  | }
41 |  |  |  |  | else { # use XS module
42 | 1 | 9µs |  |  | push @ISA, "version::vxs";
43 | 1 | 2µs |  |  | local $^W;
44 | 1 | 2µs |  |  | *version::declare = \&version::vxs::declare;
45 | 1 | 700ns |  |  | *version::qv = \&version::vxs::qv;
46 | 1 | 600ns |  |  | *version::_VERSION = \&version::vxs::_VERSION;
47 | 1 | 500ns |  |  | *version::vcmp = \&version::vxs::VCMP;
48 | 1 | 600ns |  |  | *version::new = \&version::vxs::new;
49 | 1 | 600ns |  |  | *version::numify = \&version::vxs::numify;
50 | 1 | 500ns |  |  | *version::normal = \&version::vxs::normal;
51 | 1 | 2µs |  |  | if ($] >= 5.009000) {
52 | 2 | 148µs | 2 | 38µs | # spent 24µs (10+14) within version::BEGIN@52 which was called: # once (10µs+14µs) by experimental::BEGIN@5 at line 52 no strict 'refs'; # spent 24µs making 1 call to version::BEGIN@52 # spent 14µs making 1 call to strict::unimport
53 | 1 | 700ns |  |  | *version::stringify = \&version::vxs::stringify;
54 | 1 | 2µs |  |  | *{'version::(""'} = \&version::vxs::stringify;
55 | 1 | 900ns |  |  | *{'version::(<=>'} = \&version::vxs::VCMP;
56 | 1 | 800ns |  |  | *{'version::(cmp'} = \&version::vxs::VCMP;
57 | 1 | 700ns |  |  | *version::parse = \&version::vxs::parse;
58 |  |  |  |  | }
59 |  |  |  |  | }
60 |  |  |  |  | }
61 |  |  |  |  |
62 |  |  |  |  | # avoid using Exporter
63 | 1 | 234µs |  |  | require version::regex;
64 | 1 | 2µs |  |  | *version::is_lax = \&version::regex::is_lax;
65 | 1 | 600ns |  |  | *version::is_strict = \&version::regex::is_strict;
66 | 1 | 700ns |  |  | *LAX = \$version::regex::LAX;
67 | 1 | 300ns |  |  | *STRICT = \$version::regex::STRICT;
68 |  |  |  |  |
69 |  |  |  |  | sub import {
70 | 2 | 450µs | 2 | 36µs | # spent 23µs (10+13) within version::BEGIN@70 which was called: # once (10µs+13µs) by experimental::BEGIN@5 at line 70 no strict 'refs'; # spent 23µs making 1 call to version::BEGIN@70 # spent 13µs making 1 call to strict::unimport
71 |  |  |  |  | my ($class) = shift;
72 |  |  |  |  |
73 |  |  |  |  | # Set up any derived class
74 |  |  |  |  | unless ($class eq $CLASS) {
75 |  |  |  |  | local $^W;
76 |  |  |  |  | *{$class.'::declare'} = \&{$CLASS.'::declare'};
77 |  |  |  |  | *{$class.'::qv'} = \&{$CLASS.'::qv'};
78 |  |  |  |  | }
79 |  |  |  |  |
80 |  |  |  |  | my %args;
81 |  |  |  |  | if (@_) { # any remaining terms are arguments
82 |  |  |  |  | map { $args{$_} = 1 } @_
83 |  |  |  |  | }
84 |  |  |  |  | else { # no parameters at all on use line
85 |  |  |  |  | %args =
86 |  |  |  |  | (
87 |  |  |  |  | qv => 1,
88 |  |  |  |  | 'UNIVERSAL::VERSION' => 1,
89 |  |  |  |  | );
90 |  |  |  |  | }
91 |  |  |  |  |
92 |  |  |  |  | my $callpkg = caller();
93 |  |  |  |  |
94 |  |  |  |  | if (exists($args{declare})) {
95 |  |  |  |  | *{$callpkg.'::declare'} =
96 |  |  |  |  | sub {return $class->declare(shift) }
97 |  |  |  |  | unless defined(&{$callpkg.'::declare'});
98 |  |  |  |  | }
99 |  |  |  |  |
100 |  |  |  |  | if (exists($args{qv})) {
101 |  |  |  |  | *{$callpkg.'::qv'} =
102 |  |  |  |  | sub {return $class->qv(shift) }
103 |  |  |  |  | unless defined(&{$callpkg.'::qv'});
104 |  |  |  |  | }
105 |  |  |  |  |
106 |  |  |  |  | if (exists($args{'UNIVERSAL::VERSION'})) {
107 |  |  |  |  | local $^W;
108 |  |  |  |  | *UNIVERSAL::VERSION
109 |  |  |  |  | = \&{$CLASS.'::_VERSION'};
110 |  |  |  |  | }
111 |  |  |  |  |
112 |  |  |  |  | if (exists($args{'VERSION'})) {
113 |  |  |  |  | *{$callpkg.'::VERSION'} = \&{$CLASS.'::_VERSION'};
114 |  |  |  |  | }
115 |  |  |  |  |
116 |  |  |  |  | if (exists($args{'is_strict'})) {
117 |  |  |  |  | *{$callpkg.'::is_strict'} = \&{$CLASS.'::is_strict'}
118 |  |  |  |  | unless defined(&{$callpkg.'::is_strict'});
119 |  |  |  |  | }
120 |  |  |  |  |
121 |  |  |  |  | if (exists($args{'is_lax'})) {
122 |  |  |  |  | *{$callpkg.'::is_lax'} = \&{$CLASS.'::is_lax'}
123 |  |  |  |  | unless defined(&{$callpkg.'::is_lax'});
124 |  |  |  |  | }
125 |  |  |  |  | }
126 |  |  |  |  |
127 |  |  |  |  |
128 | 1 | 29µs |  |  | 1;