← Index
NYTProf Performance Profile   « line view »
For examples/benchmark4.pl
  Run on Thu Aug 28 19:01:43 2014
Reported on Thu Aug 28 19:02:42 2014

Filename/usr/lib/perl5/NetAddr/IP/InetBase.pm
StatementsExecuted 430540 statements in 994ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
4782211350ms401msNetAddr::IP::InetBase::::fillIPv4NetAddr::IP::InetBase::fillIPv4
4782231316ms946msNetAddr::IP::InetBase::::inet_atonNetAddr::IP::InetBase::inet_aton
4782211229ms229msNetAddr::IP::InetBase::::CORE:ghbynameNetAddr::IP::InetBase::CORE:ghbyname (opcode)
478447151.8ms51.8msNetAddr::IP::InetBase::::CORE:matchNetAddr::IP::InetBase::CORE:match (opcode)
1111.17ms1.41msNetAddr::IP::InetBase::::BEGIN@9NetAddr::IP::InetBase::BEGIN@9
322126µs158µsNetAddr::IP::InetBase::::ipv6_atonNetAddr::IP::InetBase::ipv6_aton
22226µs352µsNetAddr::IP::InetBase::::importNetAddr::IP::InetBase::import
33223µs584µsNetAddr::IP::InetBase::::inet_any2nNetAddr::IP::InetBase::inet_any2n
162116µs16µsNetAddr::IP::InetBase::::CORE:substNetAddr::IP::InetBase::CORE:subst (opcode)
11110µs42µsNetAddr::IP::InetBase::::BEGIN@125NetAddr::IP::InetBase::BEGIN@125
11110µs22µsNetAddr::IP::InetBase::::BEGIN@4NetAddr::IP::InetBase::BEGIN@4
1119µs17µsNetAddr::IP::InetBase::::BEGIN@71NetAddr::IP::InetBase::BEGIN@71
1117µs65µsNetAddr::IP::InetBase::::BEGIN@8NetAddr::IP::InetBase::BEGIN@8
1116µs6µsNetAddr::IP::InetBase::::BEGIN@124NetAddr::IP::InetBase::BEGIN@124
1116µs6µsNetAddr::IP::InetBase::::upperNetAddr::IP::InetBase::upper
3113µs3µsNetAddr::IP::InetBase::::CORE:packNetAddr::IP::InetBase::CORE:pack (opcode)
0000s0sNetAddr::IP::InetBase::::DESTROYNetAddr::IP::InetBase::DESTROY
0000s0sNetAddr::IP::InetBase::::__ANON__[:109]NetAddr::IP::InetBase::__ANON__[:109]
0000s0sNetAddr::IP::InetBase::::fake_AF_INET6NetAddr::IP::InetBase::fake_AF_INET6
0000s0sNetAddr::IP::InetBase::::ipv6_n2dNetAddr::IP::InetBase::ipv6_n2d
0000s0sNetAddr::IP::InetBase::::ipv6_n2xNetAddr::IP::InetBase::ipv6_n2x
0000s0sNetAddr::IP::InetBase::::isAnyIPv4NetAddr::IP::InetBase::isAnyIPv4
0000s0sNetAddr::IP::InetBase::::isIPv4NetAddr::IP::InetBase::isIPv4
0000s0sNetAddr::IP::InetBase::::isNewIPv4NetAddr::IP::InetBase::isNewIPv4
0000s0sNetAddr::IP::InetBase::::lowerNetAddr::IP::InetBase::lower
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1
- -
4229µs233µs
# spent 22µs (10+11) within NetAddr::IP::InetBase::BEGIN@4 which was called: # once (10µs+11µs) by NetAddr::IP::Lite::BEGIN@9 at line 4
# spent 22µs making 1 call to NetAddr::IP::InetBase::BEGIN@4 # spent 11µs making 1 call to strict::import
- -
8234µs2124µs
# spent 65µs (7+59) within NetAddr::IP::InetBase::BEGIN@8 which was called: # once (7µs+59µs) by NetAddr::IP::Lite::BEGIN@9 at line 8
# spent 65µs making 1 call to NetAddr::IP::InetBase::BEGIN@8 # spent 59µs making 1 call to vars::import
92234µs21.54ms
# spent 1.41ms (1.17+231µs) within NetAddr::IP::InetBase::BEGIN@9 which was called: # once (1.17ms+231µs) by NetAddr::IP::Lite::BEGIN@9 at line 9
# spent 1.41ms making 1 call to NetAddr::IP::InetBase::BEGIN@9 # spent 135µs making 1 call to AutoLoader::import
101600ns
- -
1217µs
- -
14315µs14µs
# spent 4µs making 1 call to NetAddr::IP::InetBase::CORE:match
- -
1612µs
- -
3816µs
- -
691300ns
- -
713275µs226µs
# spent 17µs (9+8) within NetAddr::IP::InetBase::BEGIN@71 which was called: # once (9µs+8µs) by NetAddr::IP::Lite::BEGIN@9 at line 71
# spent 17µs making 1 call to NetAddr::IP::InetBase::BEGIN@71 # spent 8µs making 1 call to warnings::unimport
- -
7311µs
- -
77184µs
- -
7911µs
- -
8125µs1414µs
# spent 414µs making 1 call to AutoLoader::AUTOLOAD
- -
85294µs
8614µs1170µs
# spent 170µs making 1 call to Exporter::import
- -
9012µs
- -
931400ns
- -
109
- -
119
- -
124
# spent 6µs within NetAddr::IP::InetBase::BEGIN@124 which was called: # once (6µs+0s) by NetAddr::IP::Lite::BEGIN@9 at line 128
125259µs273µs
# spent 42µs (10+31) within NetAddr::IP::InetBase::BEGIN@125 which was called: # once (10µs+31µs) by NetAddr::IP::Lite::BEGIN@9 at line 125
# spent 42µs making 1 call to NetAddr::IP::InetBase::BEGIN@125 # spent 31µs making 1 call to vars::import
1261600ns
12716µs
1281740µs16µs
# spent 6µs making 1 call to NetAddr::IP::InetBase::BEGIN@124
- -
1301200ns
- -
132312µs
# spent 6µs within NetAddr::IP::InetBase::upper which was called: # once (6µs+0s) by NetAddr::IP::InetBase::import at line 274
133
- -
135
- -
141
- -
167
# spent 401ms (350+51.8) within NetAddr::IP::InetBase::fillIPv4 which was called 47822 times, avg 8µs/call: # 47822 times (350ms+51.8ms) by NetAddr::IP::InetBase::inet_aton at line 206, avg 8µs/call
1684782212.6ms
169478226.05ms
17047822153ms4782251.8ms
# spent 51.8ms making 47822 calls to NetAddr::IP::InetBase::CORE:match, avg 1µs/call
1714782239.2ms
- -
1734782291.5ms
- -
1774782254.0ms
- -
20247822115ms
- -
205
# spent 946ms (316+630) within NetAddr::IP::InetBase::inet_aton which was called 47822 times, avg 20µs/call: # 47820 times (316ms+630ms) by NetAddr::IP::Lite::_xnew at line 1042 of NetAddr/IP/Lite.pm, avg 20µs/call # once (12µs+52µs) by NetAddr::IP::BEGIN@8 at line 648 of NetAddr/IP/Lite.pm # once (5µs+16µs) by NetAddr::IP::BEGIN@8 at line 651 of NetAddr/IP/Lite.pm
2064782255.4ms47822401ms
# spent 401ms making 47822 calls to NetAddr::IP::InetBase::fillIPv4, avg 8µs/call
20747822465ms47822229ms
# spent 229ms making 47822 calls to NetAddr::IP::InetBase::CORE:ghbyname, avg 5µs/call
- -
2441300ns111µs
# spent 11µs making 1 call to main::CORE:pack
2451200ns1900ns
# spent 900ns making 1 call to main::CORE:pack
- -
247
- -
2561200ns12µs
# spent 2µs making 1 call to main::CORE:pack
- -
258
- -
263
- -
270
- -
272
# spent 352µs (26+325) within NetAddr::IP::InetBase::import which was called 2 times, avg 176µs/call: # once (16µs+182µs) by NetAddr::IP::Util::BEGIN@11 at line 11 of NetAddr/IP/Util.pm # once (10µs+144µs) by NetAddr::IP::Lite::BEGIN@9 at line 9 of NetAddr/IP/Lite.pm
27323µs
2741900ns16µs
# spent 6µs making 1 call to NetAddr::IP::InetBase::upper
27512µs
- -
277210µs227µs
# spent 27µs making 2 calls to Exporter::export_to_level, avg 14µs/call
- -
280120µs
- -
406
# spent 158µs (126+32) within NetAddr::IP::InetBase::ipv6_aton which was called 3 times, avg 53µs/call: # 2 times (70µs+18µs) by NetAddr::IP::InetBase::inet_any2n at line 490, avg 44µs/call # once (56µs+14µs) by NetAddr::IP::InetBase::inet_any2n at line 24 of AutoLoader.pm
sub ipv6_aton {
40731µs my($ipv6) = @_;
4083300ns return undef unless $ipv6;
40937µs local($1,$2,$3,$4,$5);
410313µs36µs if ($ipv6 =~ /^(.*:)(\d{1,3})\.(\d{1,3})\.(\d{1,3})\.(\d{1,3})$/) { # mixed hex, dot-quad
# spent 6µs making 3 calls to NetAddr::IP::InetBase::CORE:match, avg 2µs/call
41124µs return undef if $2 > 255 || $3 > 255 || $4 > 255 || $5 > 255;
41226µs $ipv6 = sprintf("%s%X%02X:%X%02X",$1,$2,$3,$4,$5); # convert to pure hex
413 }
4143300ns my $c;
415 return undef if
416327µs129µs $ipv6 =~ /[^:0-9a-fA-F]/ || # non-hex character
# spent 5µs making 9 calls to NetAddr::IP::InetBase::CORE:match, avg 567ns/call # spent 4µs making 3 calls to NetAddr::IP::InetBase::CORE:subst, avg 1µs/call
417 (($c = $ipv6) =~ s/::/x/ && $c =~ /(?:x|:):/) || # double :: ::?
418 $ipv6 =~ /[0-9a-fA-F]{5,}/; # more than 4 digits
41936µs $c = $ipv6 =~ tr/:/:/; # count the colons
420310µs31µs return undef if $c < 7 && $ipv6 !~ /::/;
# spent 1µs making 3 calls to NetAddr::IP::InetBase::CORE:match, avg 367ns/call
4213500ns if ($c > 7) { # strip leading or trailing ::
422 return undef unless
423 $ipv6 =~ s/^::/:/ ||
424 $ipv6 =~ s/::$/:/;
425 return undef if --$c > 7;
426 }
42732µs while ($c++ < 7) { # expand compressed fields
4281335µs1312µs $ipv6 =~ s/::/:::/;
# spent 12µs making 13 calls to NetAddr::IP::InetBase::CORE:subst, avg 954ns/call
429 }
43036µs3900ns $ipv6 .= 0 if $ipv6 =~ /:$/;
# spent 900ns making 3 calls to NetAddr::IP::InetBase::CORE:match, avg 300ns/call
43138µs my @hex = split(/:/,$ipv6);
43233µs foreach(0..$#hex) {
4332411µs $hex[$_] = hex($hex[$_] || 0);
434 }
435324µs33µs pack("n8",@hex);
# spent 3µs making 3 calls to NetAddr::IP::InetBase::CORE:pack, avg 933ns/call
436}
437
438# end of NetAddr::IP::InetBase::ipv6_aton
43912µs1;
440
- -
485
# spent 584µs (23+561) within NetAddr::IP::InetBase::inet_any2n which was called 3 times, avg 195µs/call: # once (11µs+471µs) by NetAddr::IP::BEGIN@8 at line 24 of AutoLoader.pm # once (8µs+50µs) by NetAddr::IP::BEGIN@8 at line 650 of NetAddr/IP/Lite.pm # once (4µs+40µs) by NetAddr::IP::BEGIN@8 at line 653 of NetAddr/IP/Lite.pm
sub inet_any2n($) {
48632µs my($addr) = @_;
4873400ns $addr = '' unless $addr;
48839µs32µs $addr = '::' . $addr
# spent 2µs making 3 calls to NetAddr::IP::InetBase::CORE:match, avg 633ns/call
489 unless $addr =~ /:/;
490313µs3489µs return ipv6_aton($addr);
# spent 401µs making 1 call to AutoLoader::AUTOLOAD # spent 88µs making 2 calls to NetAddr::IP::InetBase::ipv6_aton, avg 44µs/call
491}
492
493# end of NetAddr::IP::InetBase::inet_any2n
49412µs1;
 
# spent 229ms within NetAddr::IP::InetBase::CORE:ghbyname which was called 47822 times, avg 5µs/call: # 47822 times (229ms+0s) by NetAddr::IP::InetBase::inet_aton at line 207, avg 5µs/call
sub NetAddr::IP::InetBase::CORE:ghbyname; # opcode
# spent 51.8ms within NetAddr::IP::InetBase::CORE:match which was called 47844 times, avg 1µs/call: # 47822 times (51.8ms+0s) by NetAddr::IP::InetBase::fillIPv4 at line 170, avg 1µs/call # 9 times (5µs+0s) by NetAddr::IP::InetBase::ipv6_aton at line 416, avg 567ns/call # 3 times (6µs+0s) by NetAddr::IP::InetBase::ipv6_aton at line 410, avg 2µs/call # 3 times (2µs+0s) by NetAddr::IP::InetBase::inet_any2n at line 488, avg 633ns/call # 3 times (1µs+0s) by NetAddr::IP::InetBase::ipv6_aton at line 420, avg 367ns/call # 3 times (900ns+0s) by NetAddr::IP::InetBase::ipv6_aton at line 430, avg 300ns/call # once (4µs+0s) by NetAddr::IP::Lite::BEGIN@9 at line 14
sub NetAddr::IP::InetBase::CORE:match; # opcode
# spent 3µs within NetAddr::IP::InetBase::CORE:pack which was called 3 times, avg 933ns/call: # 3 times (3µs+0s) by NetAddr::IP::InetBase::ipv6_aton at line 435, avg 933ns/call
sub NetAddr::IP::InetBase::CORE:pack; # opcode
# spent 16µs within NetAddr::IP::InetBase::CORE:subst which was called 16 times, avg 1µs/call: # 13 times (12µs+0s) by NetAddr::IP::InetBase::ipv6_aton at line 428, avg 954ns/call # 3 times (4µs+0s) by NetAddr::IP::InetBase::ipv6_aton at line 416, avg 1µs/call
sub NetAddr::IP::InetBase::CORE:subst; # opcode