← Index
NYTProf Performance Profile   « line view »
For /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage
  Run on Mon Jan 29 16:55:34 2018
Reported on Mon Jan 29 16:57:06 2018

Filename/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/5.22.0/vars.pm
StatementsExecuted 432 statements in 1.17ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
282822639µs780µsvars::::importvars::import
23431142µs142µsvars::::CORE:matchvars::CORE:match (opcode)
111119µs187µsvars::::BEGIN@7vars::BEGIN@7
1119µs9µsvars::::BEGIN@3vars::BEGIN@3
1114µs11µ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
3233µs19µs
# spent 9µs within vars::BEGIN@3 which was called: # once (9µs+0s) by Attribute::Handlers::BEGIN@6 at line 3
use 5.006;
# spent 9µs making 1 call to vars::BEGIN@3
4
51300nsour $VERSION = '1.03';
6
72130µs2256µs
# spent 187µs (119+69) within vars::BEGIN@7 which was called: # once (119µs+69µs) by Attribute::Handlers::BEGIN@6 at line 7
use warnings::register;
# spent 187µs making 1 call to vars::BEGIN@7 # spent 69µs making 1 call to warnings::register::import
82186µs219µs
# spent 11µs (4+8) within vars::BEGIN@8 which was called: # once (4µs+8µs) by Attribute::Handlers::BEGIN@6 at line 8
use strict qw(vars subs);
# spent 11µs making 1 call to vars::BEGIN@8 # spent 8µs making 1 call to strict::import
9
10
# spent 780µs (639+142) within vars::import which was called 28 times, avg 28µs/call: # once (66µs+13µs) by Getopt::Long::BEGIN@45 at line 45 of Getopt/Long.pm # once (50µs+10µs) by File::HomeDir::BEGIN@13 at line 13 of File/HomeDir.pm # once (42µs+8µs) by Getopt::Long::BEGIN@51 at line 51 of Getopt/Long.pm # once (41µs+8µs) by Getopt::Long::BEGIN@48 at line 48 of Getopt/Long.pm # once (29µs+6µs) by Getopt::Long::BEGIN@46 at line 46 of Getopt/Long.pm # once (25µs+9µs) by List::MoreUtils::XS::BEGIN@7 at line 7 of List/MoreUtils/XS.pm # once (28µs+5µs) by Params::Util::BEGIN@65 at line 65 of Params/Util.pm # once (26µs+5µs) by DBI::Const::GetInfoType::BEGIN@16 at line 16 of DBI/Const/GetInfoType.pm # once (25µs+5µs) by Getopt::Long::BEGIN@26 at line 26 of Getopt/Long.pm # once (24µs+6µs) by Regexp::Common::BEGIN@19 at line 19 of Regexp/Common.pm # once (24µs+5µs) by Digest::MD5::BEGIN@4 at line 4 of Digest/MD5.pm # once (24µs+5µs) by File::Spec::Functions::BEGIN@6 at line 6 of File/Spec/Functions.pm # once (19µs+7µs) by File::Spec::BEGIN@4 at line 4 of File/Spec.pm # once (20µs+6µs) by Attribute::Handlers::BEGIN@6 at line 6 of Attribute/Handlers.pm # once (20µs+5µs) by IO::Select::BEGIN@11 at line 11 of IO/Select.pm # once (17µs+4µs) by Getopt::Long::BEGIN@19 at line 19 of Getopt/Long.pm # once (16µs+4µs) by File::HomeDir::Driver::BEGIN@10 at line 10 of File/HomeDir/Driver.pm # once (16µs+3µs) by parent::BEGIN@3 at line 3 of parent.pm # once (16µs+3µs) by List::MoreUtils::PP::BEGIN@327 at line 327 of List/MoreUtils/PP.pm # once (15µs+4µs) by base::BEGIN@5 at line 5 of base.pm # once (14µs+5µs) by Config::BEGIN@11 at line 11 of Config.pm # once (16µs+3µs) by File::HomeDir::FreeDesktop::BEGIN@15 at line 15 of File/HomeDir/FreeDesktop.pm # once (14µs+3µs) by File::HomeDir::Unix::BEGIN@10 at line 10 of File/HomeDir/Unix.pm # once (15µs+2µs) by Getopt::Long::BEGIN@22 at line 22 of Getopt/Long.pm # once (10µs+2µs) by B::Deparse::BEGIN@51 at line 51 of B/Deparse.pm # once (9µs+2µs) by Regexp::Common::delimited::BEGIN@8 at line 8 of Regexp/Common/delimited.pm # once (9µs+2µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm # once (8µs+2µs) by File::Spec::Unix::BEGIN@4 at line 4 of File/Spec/Unix.pm
sub import {
112818µs my $callpack = caller;
122830µs my (undef, @imports) = @_;
13285µs my ($sym, $ch);
142891µs foreach (@imports) {
1578266µs7895µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 95µs making 78 calls to vars::CORE:match, avg 1µs/call
1678101µs7827µs if ($sym =~ /\W/) {
# spent 27µs making 78 calls to vars::CORE:match, avg 350ns/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 }
2878118µs7819µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 19µs making 78 calls to vars::CORE:match, avg 247ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
3578185µ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 142µs within vars::CORE:match which was called 234 times, avg 605ns/call: # 78 times (95µs+0s) by vars::import at line 15, avg 1µs/call # 78 times (27µs+0s) by vars::import at line 16, avg 350ns/call # 78 times (19µs+0s) by vars::import at line 28, avg 247ns/call
sub vars::CORE:match; # opcode