← Index
NYTProf Performance Profile   « line view »
For rbm/rbm
  Run on Wed Feb 12 03:38:15 2020
Reported on Wed Feb 12 04:56:35 2020

Filename/usr/share/perl/5.28/vars.pm
StatementsExecuted 528 statements in 1.45ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
212113849µs1.03msvars::::importvars::import
32731183µs183µsvars::::CORE:matchvars::CORE:match (opcode)
11122µs22µsvars::::BEGIN@3vars::BEGIN@3
1118µs47µsvars::::BEGIN@7vars::BEGIN@7
1114µs17µ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
3258µs122µs
# spent 22µs within vars::BEGIN@3 which was called: # once (22µs+0s) by parent::BEGIN@3 at line 3
use 5.006;
# spent 22µs making 1 call to vars::BEGIN@3
4
51500nsour $VERSION = '1.04';
6
7228µs286µs
# spent 47µs (8+39) within vars::BEGIN@7 which was called: # once (8µs+39µs) by parent::BEGIN@3 at line 7
use warnings::register;
# spent 47µs making 1 call to vars::BEGIN@7 # spent 39µs making 1 call to warnings::register::import
82306µs229µs
# spent 17µs (4+12) within vars::BEGIN@8 which was called: # once (4µs+12µs) by parent::BEGIN@3 at line 8
use strict qw(vars subs);
# spent 17µs making 1 call to vars::BEGIN@8 # spent 12µs making 1 call to strict::import
9
10
# spent 1.03ms (849µs+183µs) within vars::import which was called 21 times, avg 49µs/call: # once (119µs+24µs) by File::Copy::Recursive::BEGIN@16 at line 16 of File/Copy/Recursive.pm # once (108µs+24µs) by Template::Config::BEGIN@24 at line 24 of Template/Config.pm # once (55µs+11µs) by Getopt::Long::BEGIN@46 at line 46 of Getopt/Long.pm # once (51µs+11µs) by Data::Dump::BEGIN@16 at line 16 of Data/Dump.pm # once (45µs+8µs) by File::Path::BEGIN@20 at line 20 of File/Path.pm # once (42µs+10µs) by Digest::SHA::BEGIN@7 at line 7 of Digest/SHA.pm # once (40µs+9µs) by IO::CaptureOutput::BEGIN@9 at line 9 of IO/CaptureOutput.pm # once (40µs+8µs) by File::Temp::BEGIN@36 at line 36 of File/Temp.pm # once (39µs+8µs) by Template::Constants::BEGIN@28 at line 28 of Template/Constants.pm # once (37µs+7µs) by Getopt::Long::BEGIN@52 at line 52 of Getopt/Long.pm # once (36µs+6µs) by Getopt::Long::BEGIN@49 at line 49 of Getopt/Long.pm # once (33µs+8µs) by String::ShellQuote::BEGIN@29 at line 29 of String/ShellQuote.pm # once (31µs+8µs) by Data::Dump::BEGIN@4 at line 4 of Data/Dump.pm # once (31µs+5µs) by Getopt::Long::BEGIN@47 at line 47 of Getopt/Long.pm # once (27µs+7µs) by Digest::MD5::BEGIN@4 at line 4 of Digest/MD5.pm # once (27µs+7µs) by Template::Constants::BEGIN@27 at line 27 of Template/Constants.pm # once (23µs+6µs) by Getopt::Long::BEGIN@20 at line 20 of Getopt/Long.pm # once (23µs+5µs) by Getopt::Long::BEGIN@27 at line 27 of Getopt/Long.pm # once (17µs+4µs) by parent::BEGIN@3 at line 3 of parent.pm # once (14µs+5µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm # once (10µs+2µs) by Getopt::Long::BEGIN@23 at line 23 of Getopt/Long.pm
sub import {
112115µs my $callpack = caller;
122129µs my (undef, @imports) = @_;
13216µs my ($sym, $ch);
142177µs foreach (@imports) {
15109341µs109125µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 125µs making 109 calls to vars::CORE:match, avg 1µs/call
16109141µs10931µs if ($sym =~ /\W/) {
# spent 31µs making 109 calls to vars::CORE:match, avg 286ns/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 }
28109161µs10926µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 26µs making 109 calls to vars::CORE:match, avg 240ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
35109288µ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
4613µs1;
47__END__
 
# spent 183µs within vars::CORE:match which was called 327 times, avg 559ns/call: # 109 times (125µs+0s) by vars::import at line 15, avg 1µs/call # 109 times (31µs+0s) by vars::import at line 16, avg 286ns/call # 109 times (26µs+0s) by vars::import at line 28, avg 240ns/call
sub vars::CORE:match; # opcode