← 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/share/perl/5.18/strict.pm
StatementsExecuted 437 statements in 531µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
3221224µs224µsstrict::::bitsstrict::bits
18181788µs227µsstrict::::importstrict::import
1414869µs153µsstrict::::unimportstrict::unimport
11129µs29µsstrict::::CORE:regcompstrict::CORE:regcomp (opcode)
11110µs10µsstrict::::CORE:matchstrict::CORE:match (opcode)
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package strict;
2
311µs$strict::VERSION = "1.07";
4
5# Verify that we're called correctly so that strictures will work.
6171µs238µsunless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) {
# spent 29µs making 1 call to strict::CORE:regcomp # spent 10µs making 1 call to strict::CORE:match
7 # Can't use Carp, since Carp uses us!
8 my (undef, $f, $l) = caller;
9 die("Incorrect use of pragma '${\__PACKAGE__}' at $f line $l.\n");
10}
11
1213µsmy %bitmask = (
13refs => 0x00000002,
14subs => 0x00000200,
15vars => 0x00000400
16);
1711µsmy %explicit_bitmask = (
18refs => 0x00000020,
19subs => 0x00000040,
20vars => 0x00000080
21);
22
23
# spent 224µs within strict::bits which was called 32 times, avg 7µs/call: # 18 times (139µs+0s) by strict::import at line 44, avg 8µs/call # 14 times (85µs+0s) by strict::unimport at line 49, avg 6µs/call
sub bits {
24329µs my $bits = 0;
25324µs my @wrong;
263230µs foreach my $s (@_) {
276931µs if (exists $bitmask{$s}) {
286950µs $^H |= $explicit_bitmask{$s};
29 }
30 else { push @wrong, $s };
316958µs $bits |= $bitmask{$s} || 0;
32 }
33328µs if (@wrong) {
34 require Carp;
35 Carp::croak("Unknown 'strict' tag(s) '@wrong'");
36 }
3732110µs $bits;
38}
39
4011µsmy @default_bits = qw(refs subs vars);
41
42
# spent 227µs (88+139) within strict::import which was called 18 times, avg 13µs/call: # once (10µs+16µs) by main::BEGIN@1 at line 1 of examples/benchmark4.pl # once (5µs+10µs) by NetAddr::IP::UtilPolluted::BEGIN@197 at line 197 of NetAddr/IP/Util.pm # once (6µs+7µs) by Benchmark::BEGIN@3 at line 3 of Benchmark.pm # once (5µs+8µs) by Socket6::BEGIN@38 at line 38 of Socket6.pm # once (5µs+8µs) by NetAddr::IP::FastNew::BEGIN@3 at line 3 of lib/NetAddr/IP/FastNew.pm # once (5µs+7µs) by NetAddr::IP::Util::BEGIN@4 at line 4 of NetAddr/IP/Util.pm # once (5µs+7µs) by Socket::BEGIN@3 at line 3 of Socket.pm # once (5µs+7µs) by Exporter::Heavy::BEGIN@3 at line 3 of Exporter/Heavy.pm # once (4µs+8µs) by Config::BEGIN@9 at line 9 of Config.pm # once (5µs+7µs) by AutoLoader::BEGIN@3 at line 3 of AutoLoader.pm # once (4µs+8µs) by Time::HiRes::BEGIN@4 at line 4 of Time/HiRes.pm # once (4µs+7µs) by lib::BEGIN@8 at line 8 of lib.pm # once (4µs+7µs) by NetAddr::IP::BEGIN@5 at line 5 of NetAddr/IP.pm # once (5µs+7µs) by NetAddr::IP::InetBase::BEGIN@4 at line 4 of NetAddr/IP/InetBase.pm # once (5µs+6µs) by base::BEGIN@3 at line 3 of base.pm # once (4µs+7µs) by NetAddr::IP::Lite::BEGIN@6 at line 6 of NetAddr/IP/Lite.pm # once (4µs+6µs) by Carp::BEGIN@4 at line 4 of Carp.pm # once (4µs+6µs) by vars::BEGIN@8 at line 8 of vars.pm
sub import {
43183µs shift;
441875µs18139µs $^H |= bits(@_ ? @_ : @default_bits);
# spent 139µs making 18 calls to strict::bits, avg 8µs/call
45}
46
47
# spent 153µs (69+85) within strict::unimport which was called 14 times, avg 11µs/call: # once (5µs+10µs) by AutoLoader::BEGIN@146 at line 146 of AutoLoader.pm # once (5µs+9µs) by Carp::BEGIN@433 at line 433 of Carp.pm # once (6µs+6µs) by Benchmark::BEGIN@426 at line 426 of Benchmark.pm # once (5µs+7µs) by NetAddr::IP::Lite::BEGIN@170 at line 170 of NetAddr/IP/Lite.pm # once (5µs+6µs) by Socket::BEGIN@240 at line 240 of Socket.pm # once (5µs+6µs) by Carp::BEGIN@67 at line 67 of Carp.pm # once (5µs+6µs) by AutoLoader::BEGIN@194 at line 194 of AutoLoader.pm # once (5µs+5µs) by Config::BEGIN@47 at line 47 of Config.pm # once (5µs+5µs) by Time::HiRes::BEGIN@43 at line 43 of Time/HiRes.pm # once (5µs+5µs) by AutoLoader::BEGIN@37 at line 37 of AutoLoader.pm # once (5µs+5µs) by Carp::BEGIN@18 at line 18 of Carp.pm # once (4µs+5µs) by Carp::BEGIN@448 at line 448 of Carp.pm # once (4µs+5µs) by Carp::BEGIN@8 at line 8 of Carp.pm # once (4µs+4µs) by Exporter::Heavy::BEGIN@4 at line 4 of Exporter/Heavy.pm
sub unimport {
48142µs shift;
491458µs1485µs $^H &= ~ bits(@_ ? @_ : @default_bits);
# spent 85µs making 14 calls to strict::bits, avg 6µs/call
50}
51
52116µs1;
53__END__
 
# spent 10µs within strict::CORE:match which was called: # once (10µs+0s) by main::BEGIN@1 at line 6
sub strict::CORE:match; # opcode
# spent 29µs within strict::CORE:regcomp which was called: # once (29µs+0s) by main::BEGIN@1 at line 6
sub strict::CORE:regcomp; # opcode