← Index
NYTProf Performance Profile   « line view »
For opt.pl
  Run on Wed May 13 13:47:05 2015
Reported on Wed May 13 13:47:06 2015

Filename/home/lbr/.plenv/versions/5.20.2/lib/perl5/5.20.2/strict.pm
StatementsExecuted 249 statements in 310µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1821122µs122µsstrict::::bitsstrict::bits
11111145µs134µsstrict::::importstrict::import
11136µs36µsstrict::::CORE:regcompstrict::CORE:regcomp (opcode)
77329µs63µsstrict::::unimportstrict::unimport
1119µs9µ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
31500ns$strict::VERSION = "1.08";
4
5# Verify that we're called correctly so that strictures will work.
6169µs246µsunless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) {
# spent 36µs making 1 call to strict::CORE:regcomp # spent 9µ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);
1711µsmy %explicit_bitmask = (
18refs => 0x00000020,
19subs => 0x00000040,
20vars => 0x00000080
21);
22
23
# spent 122µs within strict::bits which was called 18 times, avg 7µs/call: # 11 times (89µs+0s) by strict::import at line 44, avg 8µs/call # 7 times (33µs+0s) by strict::unimport at line 49, avg 5µs/call
sub bits {
241816µs my $bits = 0;
25183µs my @wrong;
261814µs foreach my $s (@_) {
273916µs if (exists $bitmask{$s}) {
283925µs $^H |= $explicit_bitmask{$s};
29 }
30 else { push @wrong, $s };
313926µs $bits |= $bitmask{$s} || 0;
32 }
33185µs if (@wrong) {
34 require Carp;
35 Carp::croak("Unknown 'strict' tag(s) '@wrong'");
36 }
371847µs $bits;
38}
39
4011µsmy @default_bits = qw(refs subs vars);
41
42
# spent 134µs (45+89) within strict::import which was called 11 times, avg 12µs/call: # once (6µs+19µs) by Config::BEGIN@9 at line 9 of Config.pm # once (6µs+12µs) by Encode::Config::BEGIN@7 at line 7 of Encode/Config.pm # once (5µs+8µs) by Encode::Encoding::BEGIN@4 at line 4 of Encode/Encoding.pm # once (4µs+7µs) by PerlIO::encoding::BEGIN@3 at line 3 of PerlIO/encoding.pm # once (4µs+7µs) by Encode::Alias::BEGIN@2 at line 2 of Encode/Alias.pm # once (4µs+6µs) by Encode::BEGIN@5 at line 5 of Encode.pm # once (4µs+6µs) by vars::BEGIN@8 at line 8 of vars.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+6µs) by constant::BEGIN@3 at line 3 of constant.pm # once (3µs+6µs) by Carp::BEGIN@4 at line 4 of Carp.pm
sub import {
43112µs shift;
441143µs1189µs $^H |= bits(@_ ? @_ : @default_bits);
# spent 89µs making 11 calls to strict::bits, avg 8µs/call
45}
46
47
# spent 63µs (29+33) 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 Carp::BEGIN@555 at line 555 of Carp.pm # once (5µs+5µs) by Config::BEGIN@47 at line 47 of Config.pm # once (4µs+5µs) by Carp::BEGIN@131 at line 131 of Carp.pm # once (4µs+4µ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;
49724µs733µs $^H &= ~ bits(@_ ? @_ : @default_bits);
# spent 33µs making 7 calls to strict::bits, avg 5µs/call
50}
51
52112µs1;
53__END__
 
# spent 9µs within strict::CORE:match which was called: # once (9µs+0s) by Config::BEGIN@9 at line 6
sub strict::CORE:match; # opcode
# spent 36µs within strict::CORE:regcomp which was called: # once (36µs+0s) by Config::BEGIN@9 at line 6
sub strict::CORE:regcomp; # opcode