← Index
NYTProf Performance Profile   « line view »
For opt.pl
  Run on Tue May 12 15:32:29 2015
Reported on Tue May 12 15:32:30 2015

Filename/home/lbr/.plenv/versions/5.20.2/lib/perl5/5.20.2/strict.pm
StatementsExecuted 249 statements in 304µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1821117µs117µsstrict::::bitsstrict::bits
11111157µs140µsstrict::::importstrict::import
77331µs66µsstrict::::unimportstrict::unimport
11119µs19µsstrict::::CORE:regcompstrict::CORE:regcomp (opcode)
1114µs4µ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
31400ns$strict::VERSION = "1.08";
4
5# Verify that we're called correctly so that strictures will work.
6138µs223µsunless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) {
# spent 19µs making 1 call to strict::CORE:regcomp # spent 4µ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
1212µsmy %bitmask = (
13refs => 0x00000002,
14subs => 0x00000200,
15vars => 0x00000400
16);
171600nsmy %explicit_bitmask = (
18refs => 0x00000020,
19subs => 0x00000040,
20vars => 0x00000080
21);
22
23
# spent 117µs within strict::bits which was called 18 times, avg 7µs/call: # 11 times (83µs+0s) by strict::import at line 44, avg 8µs/call # 7 times (34µs+0s) by strict::unimport at line 49, avg 5µs/call
sub bits {
24187µs my $bits = 0;
25183µs my @wrong;
261815µs foreach my $s (@_) {
273918µs if (exists $bitmask{$s}) {
283928µs $^H |= $explicit_bitmask{$s};
29 }
30 else { push @wrong, $s };
313925µs $bits |= $bitmask{$s} || 0;
32 }
33186µs if (@wrong) {
34 require Carp;
35 Carp::croak("Unknown 'strict' tag(s) '@wrong'");
36 }
371848µs $bits;
38}
39
401600nsmy @default_bits = qw(refs subs vars);
41
42
# spent 140µs (57+83) within strict::import which was called 11 times, avg 13µs/call: # once (12µs+7µs) by constant::BEGIN@3 at line 3 of constant.pm # once (6µs+10µs) by PerlIO::encoding::BEGIN@3 at line 3 of PerlIO/encoding.pm # once (6µs+9µs) by Config::BEGIN@9 at line 9 of Config.pm # once (5µs+10µs) by Encode::BEGIN@5 at line 5 of Encode.pm # once (6µs+8µs) by vars::BEGIN@8 at line 8 of vars.pm # once (5µs+8µs) by Encode::Config::BEGIN@7 at line 7 of Encode/Config.pm # once (4µs+6µs) by Encode::Encoding::BEGIN@4 at line 4 of Encode/Encoding.pm # once (4µs+7µs) by Encode::Alias::BEGIN@2 at line 2 of Encode/Alias.pm # once (3µs+6µs) by lib::BEGIN@8 at line 8 of lib.pm # once (3µs+6µs) by Petal::Tiny::BEGIN@4 at line 4 of lib/Petal/Tiny.pm # once (3µs+5µs) by Carp::BEGIN@4 at line 4 of Carp.pm
sub import {
43112µs shift;
441152µs1183µs $^H |= bits(@_ ? @_ : @default_bits);
# spent 83µs making 11 calls to strict::bits, avg 8µs/call
45}
46
47
# spent 66µs (31+34) within strict::unimport which was called 7 times, avg 9µs/call: # once (6µs+5µs) by constant::BEGIN@39 at line 39 of constant.pm # once (5µs+6µs) by Config::BEGIN@47 at line 47 of Config.pm # once (5µs+6µs) by Carp::BEGIN@555 at line 555 of Carp.pm # once (4µs+5µs) by Carp::BEGIN@131 at line 131 of Carp.pm # once (4µs+5µs) by constant::BEGIN@126 at line 126 of constant.pm # once (4µs+4µs) by constant::BEGIN@64 at line 64 of constant.pm # once (3µs+4µs) by Carp::BEGIN@575 at line 575 of Carp.pm
sub unimport {
4872µs shift;
49726µs734µs $^H &= ~ bits(@_ ? @_ : @default_bits);
# spent 34µs making 7 calls to strict::bits, avg 5µs/call
50}
51
52133µs1;
53__END__
 
# spent 4µs within strict::CORE:match which was called: # once (4µs+0s) by Config::BEGIN@9 at line 6
sub strict::CORE:match; # opcode
# spent 19µs within strict::CORE:regcomp which was called: # once (19µs+0s) by Config::BEGIN@9 at line 6
sub strict::CORE:regcomp; # opcode