Filename | /usr/share/perl/5.10/strict.pm |
Statements | Executed 292 statements in 1.21ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
47 | 47 | 47 | 362µs | 392µs | import | strict::
21 | 3 | 1 | 329µs | 329µs | bits | strict::
20 | 20 | 15 | 248µs | 526µs | unimport | strict::
1 | 1 | 1 | 17µs | 17µs | CORE:regcomp (opcode) | strict::
1 | 1 | 1 | 4µs | 4µs | CORE:match (opcode) | strict::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package strict; | ||||
2 | |||||
3 | 1 | 1µs | $strict::VERSION = "1.04"; | ||
4 | |||||
5 | # Verify that we're called correctly so that strictures will work. | ||||
6 | 1 | 36µs | 2 | 21µs | unless ( __FILE__ =~ /(^|[\/\\])\Q${\__PACKAGE__}\E\.pmc?$/ ) { # spent 17µ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 | |||||
12 | 1 | 3µs | my %bitmask = ( | ||
13 | refs => 0x00000002, | ||||
14 | subs => 0x00000200, | ||||
15 | vars => 0x00000400 | ||||
16 | ); | ||||
17 | |||||
18 | sub bits { | ||||
19 | 153 | 376µs | my $bits = 0; | ||
20 | my @wrong; | ||||
21 | foreach my $s (@_) { | ||||
22 | 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 | |||||
32 | 1 | 4µs | 1 | 21µs | my $default_bits = bits(qw(refs subs vars)); # spent 21µs making 1 call to strict::bits |
33 | |||||
34 | # spent 392µs (362+30) within strict::import which was called 47 times, avg 8µs/call:
# once (46µs+0s) by charnames::BEGIN@2 at line 2 of charnames.pm
# once (12µs+16µs) by vars::BEGIN@8 at line 8 of vars.pm
# once (10µs+14µs) by base::BEGIN@3 at line 3 of base.pm
# once (12µs+0s) by AutoLoader::BEGIN@3 at line 3 of AutoLoader.pm
# once (11µs+0s) by MARC::File::USMARC::BEGIN@9 at line 9 of MARC/File/USMARC.pm
# once (10µs+0s) by Encode::Config::BEGIN@7 at line 7 of Encode/Config.pm
# once (9µs+0s) by MARC::Charset::BEGIN@4 at line 4 of MARC/Charset.pm
# once (9µs+0s) by MARC::Batch::BEGIN@26 at line 26 of MARC/Batch.pm
# once (9µs+0s) by MARC::Charset::Table::BEGIN@34 at line 34 of MARC/Charset/Table.pm
# once (9µs+0s) by Encode::Encoding::BEGIN@4 at line 4 of Encode/Encoding.pm
# once (8µs+0s) by XML::Parser::BEGIN@20 at line 20 of XML/Parser.pm
# once (8µs+0s) by Encode::BEGIN@5 at line 5 of Encode.pm
# once (7µs+0s) by constant::BEGIN@3 at line 3 of constant.pm
# once (7µs+0s) by XML::SAX::ParserFactory::BEGIN@5 at line 5 of XML/SAX/ParserFactory.pm
# once (7µs+0s) by FileHandle::BEGIN@4 at line 4 of FileHandle.pm
# once (7µs+0s) by Config::BEGIN@9 at line 9 of Config.pm
# once (7µs+0s) by XML::SAX::Base::BEGIN@28 at line 28 of XML/SAX/Base.pm
# once (7µs+0s) by IO::Seekable::BEGIN@7 at line 7 of IO/Seekable.pm
# once (6µs+0s) by IO::Handle::BEGIN@4 at line 4 of IO/Handle.pm
# once (6µs+0s) by File::Spec::BEGIN@3 at line 3 of File/Spec.pm
# once (6µs+0s) by XML::SAX::Exception::BEGIN@3 at line 3 of XML/SAX/Exception.pm
# once (6µs+0s) by MARC::File::XML::BEGIN@4 at line 4 of MARC/File/XML.pm
# once (6µs+0s) by MARC::File::SAX::BEGIN@9 at line 9 of MARC/File/SAX.pm
# once (6µs+0s) by XML::SAX::BEGIN@5 at line 5 of XML/SAX.pm
# once (6µs+0s) by XML::SAX::Expat::BEGIN@8 at line 8 of XML/SAX/Expat.pm
# once (6µs+0s) by MARC::File::Encode::BEGIN@19 at line 19 of MARC/File/Encode.pm
# once (6µs+0s) by Class::Accessor::BEGIN@3 at line 3 of Class/Accessor.pm
# once (6µs+0s) by re::BEGIN@4 at line 4 of re.pm
# once (6µs+0s) by Fcntl::BEGIN@3 at line 3 of Fcntl.pm
# once (6µs+0s) by MARC::Charset::Code::BEGIN@3 at line 3 of MARC/Charset/Code.pm
# once (6µs+0s) by utf8::BEGIN@2 at line 2 of utf8_heavy.pl
# once (6µs+0s) by File::Spec::Unix::BEGIN@3 at line 3 of File/Spec/Unix.pm
# once (6µs+0s) by Exporter::Heavy::BEGIN@3 at line 3 of Exporter/Heavy.pm
# once (6µs+0s) by MARC::Record::BEGIN@9 at line 9 of MARC/Record.pm
# once (6µs+0s) by POSIX::BEGIN@2 at line 2 of POSIX.pm
# once (6µs+0s) by SDBM_File::BEGIN@3 at line 3 of SDBM_File.pm
# once (6µs+0s) by IO::File::BEGIN@6 at line 6 of IO/File.pm
# once (6µs+0s) by MARC::Charset::Constants::BEGIN@18 at line 18 of MARC/Charset/Constants.pm
# once (6µs+0s) by Config::BEGIN@5 at line 5 of Config_heavy.pl
# once (6µs+0s) by XML::NamespaceSupport::BEGIN@8 at line 8 of XML/NamespaceSupport.pm
# once (5µs+0s) by Unicode::Normalize::BEGIN@10 at line 10 of Unicode/Normalize.pm
# once (5µs+0s) by XML::Parser::Expat::BEGIN@5 at line 5 of XML/Parser/Expat.pm
# once (5µs+0s) by Encode::Alias::BEGIN@2 at line 2 of Encode/Alias.pm
# once (5µs+0s) by MARC::File::BEGIN@9 at line 9 of MARC/File.pm
# once (5µs+0s) by MARC::Field::BEGIN@3 at line 3 of MARC/Field.pm
# once (5µs+0s) by IO::BEGIN@7 at line 7 of IO.pm
# once (5µs+0s) by File::Basename::BEGIN@50 at line 50 of File/Basename.pm | ||||
35 | 94 | 521µs | shift; | ||
36 | 2 | 30µs | $^H |= @_ ? bits(@_) : $default_bits; # spent 30µs making 2 calls to strict::bits, avg 15µs/call | ||
37 | } | ||||
38 | |||||
39 | # spent 526µs (248+278) within strict::unimport which was called 20 times, avg 26µs/call:
# once (14µs+25µs) by Fcntl::BEGIN@184 at line 184 of Fcntl.pm
# once (17µs+17µs) by Carp::BEGIN@289 at line 289 of Carp/Heavy.pm
# once (18µs+15µs) by AutoLoader::BEGIN@138 at line 138 of AutoLoader.pm
# once (13µs+18µs) by AutoLoader::BEGIN@30 at line 30 of AutoLoader.pm
# once (13µs+17µs) by Config::BEGIN@35 at line 35 of Config.pm
# once (14µs+16µs) by FileHandle::BEGIN@46 at line 46 of FileHandle.pm
# once (14µs+15µs) by XML::Parser::Expat::BEGIN@449 at line 449 of XML/Parser/Expat.pm
# once (12µs+16µs) by XML::SAX::ParserFactory::BEGIN@37 at line 37 of XML/SAX/ParserFactory.pm
# once (13µs+15µs) by IO::Handle::BEGIN@355 at line 355 of IO/Handle.pm
# once (11µs+17µs) by Class::Accessor::BEGIN@150 at line 150 of Class/Accessor.pm
# once (13µs+14µs) by AutoLoader::BEGIN@186 at line 186 of AutoLoader.pm
# once (13µs+13µs) by utf8::BEGIN@155 at line 155 of utf8_heavy.pl
# once (11µs+15µs) by utf8::BEGIN@76 at line 76 of utf8_heavy.pl
# once (11µs+14µs) by constant::BEGIN@101 at line 101 of constant.pm
# once (12µs+12µs) by constant::BEGIN@38 at line 38 of constant.pm
# once (12µs+12µs) by File::Spec::Unix::BEGIN@145 at line 145 of File/Spec/Unix.pm
# once (9µs+14µs) by XML::Parser::Expat::BEGIN@455 at line 455 of XML/Parser/Expat.pm
# once (10µs+13µs) by Exporter::Heavy::BEGIN@4 at line 4 of Exporter/Heavy.pm
# once (12µs+0s) by MARC::File::BEGIN@57 at line 57 of MARC/File.pm
# once (6µs+0s) by POSIX::BEGIN@39 at line 39 of POSIX.pm | ||||
40 | 40 | 257µs | shift; | ||
41 | 18 | 278µs | $^H &= ~ (@_ ? bits(@_) : $default_bits); # spent 278µs making 18 calls to strict::bits, avg 15µs/call | ||
42 | } | ||||
43 | |||||
44 | 1 | 14µs | 1; | ||
45 | __END__ | ||||
# spent 4µs within strict::CORE:match which was called:
# once (4µs+0s) by MARC::File::XML::BEGIN@4 at line 6 | |||||
# spent 17µs within strict::CORE:regcomp which was called:
# once (17µs+0s) by MARC::File::XML::BEGIN@4 at line 6 |