← Index
NYTProf Performance Profile   « line view »
For rbm/rbm
  Run on Wed Feb 12 20:36:06 2020
Reported on Wed Feb 12 21:42:25 2020

Filename/usr/share/perl/5.28/vars.pm
StatementsExecuted 528 statements in 1.46ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
212113833µs1.04msvars::::importvars::import
32731206µs206µsvars::::CORE:matchvars::CORE:match (opcode)
11121µs21µsvars::::BEGIN@3vars::BEGIN@3
1117µs43µsvars::::BEGIN@7vars::BEGIN@7
1115µs16µ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µs121µs
# spent 21µs within vars::BEGIN@3 which was called: # once (21µs+0s) by parent::BEGIN@3 at line 3
use 5.006;
# spent 21µs making 1 call to vars::BEGIN@3
4
51300nsour $VERSION = '1.04';
6
7228µs278µs
# spent 43µs (7+36) within vars::BEGIN@7 which was called: # once (7µs+36µs) by parent::BEGIN@3 at line 7
use warnings::register;
# spent 43µs making 1 call to vars::BEGIN@7 # spent 36µs making 1 call to warnings::register::import
82295µs228µs
# spent 16µs (5+12) within vars::BEGIN@8 which was called: # once (5µs+12µs) by parent::BEGIN@3 at line 8
use strict qw(vars subs);
# spent 16µs making 1 call to vars::BEGIN@8 # spent 12µs making 1 call to strict::import
9
10
# spent 1.04ms (833µs+206µs) within vars::import which was called 21 times, avg 49µs/call: # once (122µs+46µs) by File::Copy::Recursive::BEGIN@16 at line 16 of File/Copy/Recursive.pm # once (102µs+20µs) by Template::Config::BEGIN@24 at line 24 of Template/Config.pm # once (57µs+12µs) by Getopt::Long::BEGIN@46 at line 46 of Getopt/Long.pm # once (48µs+11µs) by Data::Dump::BEGIN@16 at line 16 of Data/Dump.pm # once (41µs+11µ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 (40µs+8µs) by Getopt::Long::BEGIN@49 at line 49 of Getopt/Long.pm # once (37µs+9µs) by Digest::SHA::BEGIN@7 at line 7 of Digest/SHA.pm # once (36µs+8µs) by File::Path::BEGIN@20 at line 20 of File/Path.pm # once (37µs+7µs) by Template::Constants::BEGIN@28 at line 28 of Template/Constants.pm # once (33µs+9µs) by String::ShellQuote::BEGIN@29 at line 29 of String/ShellQuote.pm # once (34µs+7µs) by Getopt::Long::BEGIN@52 at line 52 of Getopt/Long.pm # once (32µs+9µs) by Digest::MD5::BEGIN@4 at line 4 of Digest/MD5.pm # once (32µs+5µs) by Getopt::Long::BEGIN@47 at line 47 of Getopt/Long.pm # once (28µs+7µs) by Data::Dump::BEGIN@4 at line 4 of Data/Dump.pm # once (26µs+6µs) by Template::Constants::BEGIN@27 at line 27 of Template/Constants.pm # once (22µs+7µ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+5µs) by parent::BEGIN@3 at line 3 of parent.pm # once (14µs+4µs) by Digest::base::BEGIN@4 at line 4 of Digest/base.pm # once (11µs+2µs) by Getopt::Long::BEGIN@23 at line 23 of Getopt/Long.pm
sub import {
112116µs my $callpack = caller;
122129µs my (undef, @imports) = @_;
13216µs my ($sym, $ch);
142176µs foreach (@imports) {
15109358µs109146µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 146µs making 109 calls to vars::CORE:match, avg 1µs/call
16109140µs10934µs if ($sym =~ /\W/) {
# spent 34µs making 109 calls to vars::CORE:match, avg 308ns/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 }
28109165µ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
35109276µ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 206µs within vars::CORE:match which was called 327 times, avg 631ns/call: # 109 times (146µs+0s) by vars::import at line 15, avg 1µs/call # 109 times (34µs+0s) by vars::import at line 16, avg 308ns/call # 109 times (26µs+0s) by vars::import at line 28, avg 240ns/call
sub vars::CORE:match; # opcode