← Index
NYTProf Performance Profile   « block view • line view • sub view »
For conv.pl
  Run on Sun Nov 14 21:27:43 2010
Reported on Sun Nov 14 21:29:10 2010

Filename/usr/share/perl/5.10/vars.pm
StatementsExecuted 259 statements in 2.29ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2222181.13ms1.38msvars::::importvars::import
111346µs511µsvars::::BEGIN@7vars::BEGIN@7
12031259µs259µsvars::::CORE:matchvars::CORE:match (opcode)
11163µs63µsvars::::BEGIN@3vars::BEGIN@3
11112µs42µsvars::::BEGIN@8vars::BEGIN@8
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package vars;
2
3399µs163µs
# spent 63µs within vars::BEGIN@3 which was called: # once (63µs+0s) by MARC::File::XML::BEGIN@5 at line 3
use 5.006;
# spent 63µs making 1 call to vars::BEGIN@3
4
512µsour $VERSION = '1.01';
6
73370µs2676µs
# spent 511µs (346+165) within vars::BEGIN@7 which was called: # once (346µs+165µs) by MARC::File::XML::BEGIN@5 at line 7
use warnings::register;
# spent 511µs making 1 call to vars::BEGIN@7 # spent 165µs making 1 call to warnings::register::import
83378µs272µs
# spent 42µs (12+30) within vars::BEGIN@8 which was called: # once (12µs+30µs) by MARC::File::XML::BEGIN@5 at line 8
use strict qw(vars subs);
# spent 42µs making 1 call to vars::BEGIN@8 # spent 30µs making 1 call to strict::import
9
10
# spent 1.38ms (1.13+259µs) within vars::import which was called 22 times, avg 63µs/call: # once (118µs+35µs) by POSIX::SigRt::BEGIN@66 at line 66 of POSIX.pm # once (103µs+24µs) by XML::SAX::ExpatXS::Encoding::BEGIN@5 at line 5 of XML/SAX/ExpatXS/Encoding.pm # once (76µs+20µs) by Storable::BEGIN@24 at line 24 of Storable.pm # once (74µs+20µs) by XML::SAX::BEGIN@6 at line 6 of XML/SAX.pm # once (72µs+19µs) by MARC::Record::BEGIN@27 at line 27 of MARC/Record.pm # once (60µs+16µs) by MARC::File::XML::BEGIN@5 at line 5 of MARC/File/XML.pm # once (63µs+12µs) by XML::SAX::ExpatXS::BEGIN@3 at line 3 of XML/SAX/ExpatXS.pm # once (59µs+13µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm # once (50µs+12µs) by XML::SAX::Exception::BEGIN@8 at line 8 of XML/SAX/Exception.pm # once (49µs+12µs) by constant::BEGIN@6 at line 6 of constant.pm # once (41µs+6µs) by XML::SAX::ExpatXS::Preload::BEGIN@13 at line 13 of XML/SAX/ExpatXS/Preload.pm # once (37µs+6µs) by MARC::File::USMARC::BEGIN@16 at line 16 of MARC/File/USMARC.pm # once (36µs+7µs) by MARC::File::USMARC::BEGIN@12 at line 12 of MARC/File/USMARC.pm # once (36µs+6µs) by MARC::File::BEGIN@12 at line 12 of MARC/File.pm # once (35µs+6µs) by XML::SAX::Base::BEGIN@29 at line 29 of XML/SAX/Base.pm # once (33µs+7µs) by MARC::Field::BEGIN@10 at line 10 of MARC/Field.pm # once (34µs+5µs) by XML::SAX::ParserFactory::BEGIN@6 at line 6 of XML/SAX/ParserFactory.pm # once (31µs+8µs) by MARC::Record::BEGIN@23 at line 23 of MARC/Record.pm # once (32µs+7µs) by MARC::Record::BEGIN@12 at line 12 of MARC/Record.pm # once (31µs+5µs) by MARC::Record::BEGIN@32 at line 32 of MARC/Record.pm # once (28µs+7µs) by base::BEGIN@4 at line 4 of base.pm # once (28µs+6µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm
sub import {
1188276µs my $callpack = caller;
12 my ($pack, @imports) = @_;
13 my ($sym, $ch);
14 foreach (@imports) {
151601.16ms40143µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 143µs making 40 calls to vars::CORE:match, avg 4µs/call
164066µs if ($sym =~ /\W/) {
# spent 66µs making 40 calls to vars::CORE:match, avg 2µs/call
17 # time for a more-detailed check-up
18 if ($sym =~ /^\w+[[{].*[]}]$/) {
19 require Carp;
20 Carp::croak("Can't declare individual elements of hash or array");
21 } elsif (warnings::enabled() and length($sym) == 1 and $sym !~ tr/a-zA-Z//) {
22 warnings::warn("No need to declare built-in vars");
23 } elsif (($^H &= strict::bits('vars'))) {
24 require Carp;
25 Carp::croak("'$_' is not a valid variable name under strict vars");
26 }
27 }
284050µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 50µs making 40 calls to vars::CORE:match, avg 1µs/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
35 : do {
36 require Carp;
37 Carp::croak("'$_' is not a valid variable name");
38 });
39 } else {
40 require Carp;
41 Carp::croak("'$_' is not a valid variable name");
42 }
43 }
44};
45
4614µs1;
47__END__
 
# spent 259µs within vars::CORE:match which was called 120 times, avg 2µs/call: # 40 times (143µs+0s) by vars::import at line 15, avg 4µs/call # 40 times (66µs+0s) by vars::import at line 16, avg 2µs/call # 40 times (50µs+0s) by vars::import at line 28, avg 1µs/call
sub vars::CORE:match; # opcode