← Index
NYTProf Performance Profile   « block view • line view • sub view »
For bin/hailo
  Run on Thu Oct 21 22:50:37 2010
Reported on Thu Oct 21 22:52:05 2010

Filename/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/version.pm
StatementsExecuted 35 statements in 904µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
661113µs113µsversion::::CORE:regcompversion::CORE:regcomp (opcode)
11163µs63µsversion::::BEGIN@4version::BEGIN@4
1212124µs24µsversion::::CORE:qrversion::CORE:qr (opcode)
11123µs23µsversion::::importversion::import
11114µs21µsversion::::BEGIN@5version::BEGIN@5
11114µs174µsversion::::BEGIN@7version::BEGIN@7
11112µs17µsversion::::__ANON__[:151]version::__ANON__[:151]
11112µs42µsversion::::BEGIN@119version::BEGIN@119
1118µs8µsversion::::(boolversion::(bool (xsub)
1115µs5µsversion::::(cmpversion::(cmp (xsub)
1115µs5µsversion::::qvversion::qv (xsub)
0000s0sversion::::__ANON__[:145]version::__ANON__[:145]
0000s0sversion::::is_laxversion::is_lax
0000s0sversion::::is_strictversion::is_strict
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
2package version;
3
4271µs163µs
# spent 63µs within version::BEGIN@4 which was called: # once (63µs+0s) by IO::Interactive::BEGIN@3 at line 4
use 5.005_04;
# spent 63µs making 1 call to version::BEGIN@4
5233µs227µs
# spent 21µs (14+7) within version::BEGIN@5 which was called: # once (14µs+7µs) by IO::Interactive::BEGIN@3 at line 5
use strict;
# spent 21µs making 1 call to version::BEGIN@5 # spent 7µs making 1 call to strict::import
6
72223µs2335µs
# spent 174µs (14+161) within version::BEGIN@7 which was called: # once (14µs+161µs) by IO::Interactive::BEGIN@3 at line 7
use vars qw(@ISA $VERSION $CLASS $STRICT $LAX *declare *qv);
# spent 174µs making 1 call to version::BEGIN@7 # spent 161µs making 1 call to vars::import
8
911µs$VERSION = 0.82;
10
1111µs$CLASS = 'version';
12
13#--------------------------------------------------------------------------#
14# Version regexp components
15#--------------------------------------------------------------------------#
16
17# Fraction part of a decimal version number. This is a common part of
18# both strict and lax decimal versions
19
20110µs14µsmy $FRACTION_PART = qr/\.[0-9]+/;
# spent 4µs making 1 call to version::CORE:qr
21
22# First part of either decimal or dotted-decimal strict version number.
23# Unsigned integer with no leading zeroes (except for zero itself) to
24# avoid confusion with octal.
25
2615µs12µsmy $STRICT_INTEGER_PART = qr/0|[1-9][0-9]*/;
# spent 2µs making 1 call to version::CORE:qr
27
28# First part of either decimal or dotted-decimal lax version number.
29# Unsigned integer, but allowing leading zeros. Always interpreted
30# as decimal. However, some forms of the resulting syntax give odd
31# results if used as ordinary Perl expressions, due to how perl treats
32# octals. E.g.
33# version->new("010" ) == 10
34# version->new( 010 ) == 8
35# version->new( 010.2) == 82 # "8" . "2"
36
3715µs12µsmy $LAX_INTEGER_PART = qr/[0-9]+/;
# spent 2µs making 1 call to version::CORE:qr
38
39# Second and subsequent part of a strict dotted-decimal version number.
40# Leading zeroes are permitted, and the number is always decimal.
41# Limited to three digits to avoid overflow when converting to decimal
42# form and also avoid problematic style with excessive leading zeroes.
43
4415µs12µsmy $STRICT_DOTTED_DECIMAL_PART = qr/\.[0-9]{1,3}/;
# spent 2µs making 1 call to version::CORE:qr
45
46# Second and subsequent part of a lax dotted-decimal version number.
47# Leading zeroes are permitted, and the number is always decimal. No
48# limit on the numerical value or number of digits, so there is the
49# possibility of overflow when converting to decimal form.
50
5115µs12µsmy $LAX_DOTTED_DECIMAL_PART = qr/\.[0-9]+/;
# spent 2µs making 1 call to version::CORE:qr
52
53# Alpha suffix part of lax version number syntax. Acts like a
54# dotted-decimal part.
55
5615µs12µsmy $LAX_ALPHA_PART = qr/_[0-9]+/;
# spent 2µs making 1 call to version::CORE:qr
57
58#--------------------------------------------------------------------------#
59# Strict version regexp definitions
60#--------------------------------------------------------------------------#
61
62# Strict decimal version number.
63
64125µs216µsmy $STRICT_DECIMAL_VERSION =
# spent 14µs making 1 call to version::CORE:regcomp # spent 2µs making 1 call to version::CORE:qr
65 qr/ $STRICT_INTEGER_PART $FRACTION_PART? /x;
66
67# Strict dotted-decimal version number. Must have both leading "v" and
68# at least three parts, to avoid confusion with decimal syntax.
69
70123µs215µsmy $STRICT_DOTTED_DECIMAL_VERSION =
# spent 13µs making 1 call to version::CORE:regcomp # spent 2µs making 1 call to version::CORE:qr
71 qr/ v $STRICT_INTEGER_PART $STRICT_DOTTED_DECIMAL_PART{2,} /x;
72
73# Complete strict version number syntax -- should generally be used
74# anchored: qr/ \A $STRICT \z /x
75
76126µs218µs$STRICT =
# spent 16µs making 1 call to version::CORE:regcomp # spent 2µs making 1 call to version::CORE:qr
77 qr/ $STRICT_DECIMAL_VERSION | $STRICT_DOTTED_DECIMAL_VERSION /x;
78
79#--------------------------------------------------------------------------#
80# Lax version regexp definitions
81#--------------------------------------------------------------------------#
82
83# Lax decimal version number. Just like the strict one except for
84# allowing an alpha suffix or allowing a leading or trailing
85# decimal-point
86
87138µs224µsmy $LAX_DECIMAL_VERSION =
# spent 22µs making 1 call to version::CORE:regcomp # spent 2µs making 1 call to version::CORE:qr
88 qr/ $LAX_INTEGER_PART (?: \. | $FRACTION_PART $LAX_ALPHA_PART? )?
89 |
90 $FRACTION_PART $LAX_ALPHA_PART?
91 /x;
92
93# Lax dotted-decimal version number. Distinguished by having either
94# leading "v" or at least three non-alpha parts. Alpha part is only
95# permitted if there are at least two non-alpha parts. Strangely
96# enough, without the leading "v", Perl takes .1.2 to mean v0.1.2,
97# so when there is no "v", the leading part is optional
98
99127µs219µsmy $LAX_DOTTED_DECIMAL_VERSION =
# spent 17µs making 1 call to version::CORE:regcomp # spent 2µs making 1 call to version::CORE:qr
100 qr/
101 v $LAX_INTEGER_PART (?: $LAX_DOTTED_DECIMAL_PART+ $LAX_ALPHA_PART? )?
102 |
103 $LAX_INTEGER_PART? $LAX_DOTTED_DECIMAL_PART{2,} $LAX_ALPHA_PART?
104 /x;
105
106# Complete lax version number syntax -- should generally be used
107# anchored: qr/ \A $LAX \z /x
108#
109# The string 'undef' is a special case to make for easier handling
110# of return values from ExtUtils::MM->parse_version
111
112141µs233µs$LAX =
# spent 30µs making 1 call to version::CORE:regcomp # spent 2µs making 1 call to version::CORE:qr
113 qr/ undef | $LAX_DECIMAL_VERSION | $LAX_DOTTED_DECIMAL_VERSION /x;
114
115#--------------------------------------------------------------------------#
116
117# Preloaded methods go here.
118
# spent 23µs within version::import which was called: # once (23µs+0s) by IO::Interactive::BEGIN@3 at line 3 of IO/Interactive.pm
sub import {
1192298µs272µs
# spent 42µs (12+30) within version::BEGIN@119 which was called: # once (12µs+30µs) by IO::Interactive::BEGIN@3 at line 119
no strict 'refs';
# spent 42µs making 1 call to version::BEGIN@119 # spent 30µs making 1 call to strict::unimport
1201125µs my ($class) = shift;
121
122 # Set up any derived class
123 unless ($class eq 'version') {
124 local $^W;
125 *{$class.'::declare'} = \&version::declare;
126 *{$class.'::qv'} = \&version::qv;
127 }
128
129 my %args;
130 if (@_) { # any remaining terms are arguments
131 map { $args{$_} = 1 } @_
132 }
133 else { # no parameters at all on use line
134 %args =
135 (
136 qv => 1,
137 'UNIVERSAL::VERSION' => 1,
138 );
139 }
140
141 my $callpkg = caller();
142
143 if (exists($args{declare})) {
144 *{$callpkg.'::declare'} =
145 sub {return $class->declare(shift) }
146 unless defined(&{$callpkg.'::declare'});
147 }
148
149 if (exists($args{qv})) {
150118µs15µs *{$callpkg.'::qv'} =
# spent 5µs making 1 call to version::qv
151
# spent 17µs (12+5) within version::__ANON__[/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/version.pm:151] which was called: # once (12µs+5µs) by Hailo::_is_interactive at line 3 of IO/Interactive.pm
sub {return $class->qv(shift) }
152 unless defined(&{$callpkg.'::qv'});
153 }
154
155 if (exists($args{'VERSION'})) {
156 *{$callpkg.'::VERSION'} = \&version::_VERSION;
157 }
158
159 if (exists($args{'is_strict'})) {
160 *{$callpkg.'::is_strict'} = \&version::is_strict;
161 }
162
163 if (exists($args{'is_lax'})) {
164 *{$callpkg.'::is_lax'} = \&version::is_lax;
165 }
166}
167
168sub is_strict { defined $_[0] && $_[0] =~ qr/ \A $STRICT \z /x }
169sub is_lax { defined $_[0] && $_[0] =~ qr/ \A $LAX \z /x }
170
171120µs1;
 
# spent 8µs within version::(bool which was called: # once (8µs+0s) by DynaLoader::BEGIN@25 at line 50 of Config.pm
sub version::(bool; # xsub
# spent 5µs within version::(cmp which was called: # once (5µs+0s) by DynaLoader::BEGIN@25 at line 53 of Config.pm
sub version::(cmp; # xsub
# spent 24µs within version::CORE:qr which was called 12 times, avg 2µs/call: # once (4µs+0s) by IO::Interactive::BEGIN@3 at line 20 # once (2µs+0s) by IO::Interactive::BEGIN@3 at line 112 # once (2µs+0s) by IO::Interactive::BEGIN@3 at line 87 # once (2µs+0s) by IO::Interactive::BEGIN@3 at line 99 # once (2µs+0s) by IO::Interactive::BEGIN@3 at line 70 # once (2µs+0s) by IO::Interactive::BEGIN@3 at line 76 # once (2µs+0s) by IO::Interactive::BEGIN@3 at line 37 # once (2µs+0s) by IO::Interactive::BEGIN@3 at line 51 # once (2µs+0s) by IO::Interactive::BEGIN@3 at line 44 # once (2µs+0s) by IO::Interactive::BEGIN@3 at line 64 # once (2µs+0s) by IO::Interactive::BEGIN@3 at line 26 # once (2µs+0s) by IO::Interactive::BEGIN@3 at line 56
sub version::CORE:qr; # opcode
# spent 113µs within version::CORE:regcomp which was called 6 times, avg 19µs/call: # once (30µs+0s) by IO::Interactive::BEGIN@3 at line 112 # once (22µs+0s) by IO::Interactive::BEGIN@3 at line 87 # once (17µs+0s) by IO::Interactive::BEGIN@3 at line 99 # once (16µs+0s) by IO::Interactive::BEGIN@3 at line 76 # once (14µs+0s) by IO::Interactive::BEGIN@3 at line 64 # once (13µs+0s) by IO::Interactive::BEGIN@3 at line 70
sub version::CORE:regcomp; # opcode
# spent 5µs within version::qv which was called: # once (5µs+0s) by version::__ANON__[/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/version.pm:151] at line 150
sub version::qv; # xsub