← Index
NYTProf Performance Profile   « block view • line view • sub view »
For lexer.pl
  Run on Thu Mar 22 18:01:49 2012
Reported on Thu Mar 22 18:02:03 2012

Filename/System/Library/Perl/5.12/strict.pm
StatementsExecuted 27 statements in 212µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11145µs45µsstrict::::CORE:regcompstrict::CORE:regcomp (opcode)
22133µs33µsstrict::::bitsstrict::bits
11118µs18µsstrict::::CORE:matchstrict::CORE:match (opcode)
11118µs28µsstrict::::unimportstrict::unimport
1117µs7µsstrict::::importstrict::import
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
312µs$strict::VERSION = "1.04";
4
5# Verify that we're called correctly so that strictures will work.
6192µs263µsunless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) {
# spent 45µs making 1 call to strict::CORE:regcomp # spent 18µ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
1214µsmy %bitmask = (
13refs => 0x00000002,
14subs => 0x00000200,
15vars => 0x00000400
16);
17
18
# spent 33µs within strict::bits which was called 2 times, avg 16µs/call: # once (23µs+0s) by Parse::Lexer::BEGIN@4 at line 32 # once (10µs+0s) by strict::unimport at line 41
sub bits {
191027µs my $bits = 0;
20 my @wrong;
21 foreach my $s (@_) {
22812µs push @wrong, $s unless exists $bitmask{$s};
23 $bits |= $bitmask{$s} || 0;
24 }
25 if (@wrong) {
26 require Carp;
27 Carp::croak("Unknown 'strict' tag(s) '@wrong'");
28 }
29 $bits;
30}
31
3214µs123µsmy $default_bits = bits(qw(refs subs vars));
# spent 23µs making 1 call to strict::bits
33
34
# spent 7µs within strict::import which was called: # once (7µs+0s) by Parse::Lexer::BEGIN@4 at line 4 of Parse/Lexer.pm
sub import {
35211µs shift;
36 $^H |= @_ ? bits(@_) : $default_bits;
37}
38
39
# spent 28µs (18+10) within strict::unimport which was called: # once (18µs+10µs) by Carp::BEGIN@303 at line 303 of Carp.pm
sub unimport {
40215µs shift;
41110µs $^H &= ~ (@_ ? bits(@_) : $default_bits);
# spent 10µs making 1 call to strict::bits
42}
43
44145µs1;
45__END__
 
# spent 18µs within strict::CORE:match which was called: # once (18µs+0s) by Parse::Lexer::BEGIN@4 at line 6
sub strict::CORE:match; # opcode
# spent 45µs within strict::CORE:regcomp which was called: # once (45µs+0s) by Parse::Lexer::BEGIN@4 at line 6
sub strict::CORE:regcomp; # opcode