← Index
NYTProf Performance Profile   « line view »
For bin/benchmark-perlformance
  Run on Fri Apr 17 15:31:48 2015
Reported on Fri Apr 17 15:32:02 2015

Filename/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/5.16.3/vars.pm
StatementsExecuted 452 statements in 1.54ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
303024877µs1.08msvars::::importvars::import
24331204µs204µsvars::::CORE:matchvars::CORE:match (opcode)
111129µs189µsvars::::BEGIN@7vars::BEGIN@7
11117µs17µsvars::::BEGIN@3vars::BEGIN@3
1116µs15µ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
3263µs117µs
# spent 17µs within vars::BEGIN@3 which was called: # once (17µs+0s) by Config::BEGIN@11 at line 3
use 5.006;
# spent 17µs making 1 call to vars::BEGIN@3
4
51400nsour $VERSION = '1.02';
6
72140µs2248µs
# spent 189µs (129+60) within vars::BEGIN@7 which was called: # once (129µs+60µs) by Config::BEGIN@11 at line 7
use warnings::register;
# spent 189µs making 1 call to vars::BEGIN@7 # spent 60µs making 1 call to warnings::register::import
82195µs224µs
# spent 15µs (6+9) within vars::BEGIN@8 which was called: # once (6µs+9µs) by Config::BEGIN@11 at line 8
use strict qw(vars subs);
# spent 15µs making 1 call to vars::BEGIN@8 # spent 9µs making 1 call to strict::import
9
10
# spent 1.08ms (877µs+204µs) within vars::import which was called 30 times, avg 36µs/call: # once (75µs+14µs) by Getopt::Long::BEGIN@45 at line 45 of Getopt/Long.pm # once (64µs+22µs) by Cwd::BEGIN@172 at line 172 of Cwd.pm # once (56µs+12µs) by Config::Perl::V::BEGIN@10 at line 10 of Config/Perl/V.pm # once (46µs+9µs) by Getopt::Long::BEGIN@48 at line 48 of Getopt/Long.pm # once (46µs+9µs) by Digest::MD5::BEGIN@4 at line 4 of Digest/MD5.pm # once (42µs+10µs) by Data::Structure::Util::BEGIN@7 at line 7 of Data/Structure/Util.pm # once (41µs+9µs) by Getopt::Long::BEGIN@51 at line 51 of Getopt/Long.pm # once (37µs+9µs) by Params::Util::BEGIN@65 at line 65 of Params/Util.pm # once (37µs+8µs) by List::MoreUtils::BEGIN@8 at line 8 of List/MoreUtils.pm # once (32µs+6µs) by Storable::BEGIN@22 at line 22 of Storable.pm # once (31µs+7µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm # once (30µs+6µs) by Getopt::Long::BEGIN@46 at line 46 of Getopt/Long.pm # once (30µs+6µs) by Sys::Info::Constants::BEGIN@4 at line 4 of Sys/Info/Constants.pm # once (28µs+7µs) by Text::Balanced::BEGIN@11 at line 11 of Text/Balanced.pm # once (26µs+6µs) by Iterator::Util::BEGIN@21 at line 21 of Iterator/Util.pm # once (26µs+6µs) by Getopt::Long::BEGIN@26 at line 26 of Getopt/Long.pm # once (22µs+6µs) by Sys::Info::BEGIN@4 at line 4 of Sys/Info.pm # once (23µs+4µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm # once (19µs+5µs) by constant::BEGIN@6 at line 6 of constant.pm # once (18µs+4µs) by SelfLoader::BEGIN@9 at line 9 of SelfLoader.pm # once (16µs+5µs) by Devel::Platform::Info::BEGIN@6 at line 6 of Devel/Platform/Info.pm # once (17µs+4µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm # once (18µs+4µs) by Config::BEGIN@11 at line 11 of Config.pm # once (15µs+5µs) by Config::BEGIN@7 at line 7 of Config_heavy.pl # once (15µs+3µs) by Data::YAML::Writer::BEGIN@7 at line 7 of Data/YAML/Writer.pm # once (13µs+5µs) by Class::Data::Inheritable::BEGIN@4 at line 4 of Class/Data/Inheritable.pm # once (13µs+4µs) by Getopt::Long::BEGIN@19 at line 19 of Getopt/Long.pm # once (14µs+3µs) by Sys::Info::Base::BEGIN@4 at line 4 of Sys/Info/Base.pm # once (12µs+3µs) by base::BEGIN@4 at line 4 of base.pm # once (11µs+2µs) by Getopt::Long::BEGIN@22 at line 22 of Getopt/Long.pm
sub import {
113021µs my $callpack = caller;
123043µs my (undef, @imports) = @_;
13308µs my ($sym, $ch);
1430123µs foreach (@imports) {
1581419µs81142µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 142µs making 81 calls to vars::CORE:match, avg 2µs/call
1681133µs8135µs if ($sym =~ /\W/) {
# spent 35µs making 81 calls to vars::CORE:match, avg 435ns/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 }
2881148µs8126µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 26µs making 81 calls to vars::CORE:match, avg 325ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
3581246µs : 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
4612µs1;
47__END__
 
# spent 204µs within vars::CORE:match which was called 243 times, avg 839ns/call: # 81 times (142µs+0s) by vars::import at line 15, avg 2µs/call # 81 times (35µs+0s) by vars::import at line 16, avg 435ns/call # 81 times (26µs+0s) by vars::import at line 28, avg 325ns/call
sub vars::CORE:match; # opcode