← Index
NYTProf Performance Profile   « block view • line view • sub view »
For mongo_pain.pl
  Run on Fri Mar 25 17:00:29 2011
Reported on Fri Mar 25 17:07:06 2011

Filename/usr/share/perl/5.10/vars.pm
StatementsExecuted 239 statements in 1.68ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
141414679µs853µsvars::::importvars::import
111327µs396µsvars::::BEGIN@7vars::BEGIN@7
12931174µs174µsvars::::CORE:matchvars::CORE:match (opcode)
11130µs30µsvars::::BEGIN@3vars::BEGIN@3
1118µs22µ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
3363µs130µs
# spent 30µs within vars::BEGIN@3 which was called: # once (30µs+0s) by Scalar::Util::BEGIN@10 at line 3
use 5.006;
# spent 30µs making 1 call to vars::BEGIN@3
4
51700nsour $VERSION = '1.01';
6
73350µs2466µs
# spent 396µs (327+70) within vars::BEGIN@7 which was called: # once (327µs+70µs) by Scalar::Util::BEGIN@10 at line 7
use warnings::register;
# spent 396µs making 1 call to vars::BEGIN@7 # spent 70µs making 1 call to warnings::register::import
83374µs235µs
# spent 22µs (8+13) within vars::BEGIN@8 which was called: # once (8µs+13µs) by Scalar::Util::BEGIN@10 at line 8
use strict qw(vars subs);
# spent 22µs making 1 call to vars::BEGIN@8 # spent 13µs making 1 call to strict::import
9
10
# spent 853µs (679+174) within vars::import which was called 14 times, avg 61µs/call: # once (105µs+28µs) by Params::Validate::BEGIN@7 at line 7 of Params/Validate.pm # once (78µs+23µs) by DateTime::TimeZone::Catalog::BEGIN@15 at line 15 of DateTime/TimeZone/Catalog.pm # once (74µs+19µs) by List::Util::BEGIN@12 at line 12 of List/Util.pm # once (69µs+17µs) by Scalar::Util::BEGIN@10 at line 10 of Scalar/Util.pm # once (67µs+15µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm # once (58µs+15µs) by Time::Local::BEGIN@9 at line 9 of Time/Local.pm # once (47µs+12µs) by Digest::MD5::BEGIN@4 at line 4 of Digest/MD5.pm # once (35µs+8µs) by Tie::IxHash::BEGIN@15 at line 15 of Tie/IxHash.pm # once (35µs+9µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm # once (31µs+8µs) by constant::BEGIN@6 at line 6 of constant.pm # once (20µs+6µs) by base::BEGIN@4 at line 4 of base.pm # once (20µs+5µs) by parent::BEGIN@3 at line 3 of parent.pm # once (20µs+5µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm # once (19µs+5µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm
sub import {
11228886µs my $callpack = caller;
12 my ($pack, @imports) = @_;
13 my ($sym, $ch);
14 foreach (@imports) {
1543117µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 117µs making 43 calls to vars::CORE:match, avg 3µs/call
164332µs if ($sym =~ /\W/) {
# spent 32µs making 43 calls to vars::CORE:match, avg 740ns/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 }
284326µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 26µs making 43 calls to vars::CORE:match, avg 598ns/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 174µs within vars::CORE:match which was called 129 times, avg 1µs/call: # 43 times (117µs+0s) by vars::import at line 15, avg 3µs/call # 43 times (32µs+0s) by vars::import at line 16, avg 740ns/call # 43 times (26µs+0s) by vars::import at line 28, avg 598ns/call
sub vars::CORE:match; # opcode