← Index
NYTProf Performance Profile   « line view »
For ../prof.pl
  Run on Wed Dec 14 15:57:08 2022
Reported on Wed Dec 14 16:00:30 2022

Filename/Users/ether/perl5/perlbrew/perls/36.0/lib/5.36.0/vars.pm
StatementsExecuted 340 statements in 1.26ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
161610733µs886µsvars::::importvars::import
20131153µs153µsvars::::CORE:matchvars::CORE:match (opcode)
11116µs16µsvars::::BEGIN@3vars::BEGIN@3
1114µs38µsvars::::BEGIN@7vars::BEGIN@7
1114µs9µ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
3236µs116µs
# spent 16µs within vars::BEGIN@3 which was called: # once (16µs+0s) by Digest::SHA::BEGIN@7 at line 3
use 5.006;
# spent 16µs making 1 call to vars::BEGIN@3
4
510sour $VERSION = '1.05';
6
7216µs272µs
# spent 38µs (4+34) within vars::BEGIN@7 which was called: # once (4µs+34µs) by Digest::SHA::BEGIN@7 at line 7
use warnings::register;
# spent 38µs making 1 call to vars::BEGIN@7 # spent 34µs making 1 call to warnings::register::import
82285µs214µs
# spent 9µs (4+5) within vars::BEGIN@8 which was called: # once (4µs+5µs) by Digest::SHA::BEGIN@7 at line 8
use strict qw(vars subs);
# spent 9µs making 1 call to vars::BEGIN@8 # spent 5µs making 1 call to strict::import
9
10
# spent 886µs (733+153) within vars::import which was called 16 times, avg 55µs/call: # once (200µs+21µs) by List::MoreUtils::PP::BEGIN@413 at line 413 of List/MoreUtils/PP.pm # once (134µs+32µs) by Pod::Escapes::BEGIN@6 at line 16 of Pod/Escapes.pm # once (75µs+6µs) by Digest::SHA::BEGIN@7 at line 7 of Digest/SHA.pm # once (54µs+20µs) by List::MoreUtils::XS::BEGIN@8 at line 8 of List/MoreUtils/XS.pm # once (38µs+15µs) by Pod::Text::BEGIN@21 at line 21 of Pod/Text.pm # once (37µs+10µs) by Getopt::Long::BEGIN@46 at line 46 of Getopt/Long.pm # once (36µs+7µs) by Pod::Simple::BEGIN@14 at line 19 of Pod/Simple.pm # once (37µs+3µs) by Pod::Simple::TiedOutFH::BEGIN@6 at line 6 of Pod/Simple/TiedOutFH.pm # once (27µs+6µs) by Getopt::Long::BEGIN@49 at line 50 of Getopt/Long.pm # once (23µs+6µs) by Getopt::Long::BEGIN@52 at line 52 of Getopt/Long.pm # once (18µs+7µs) by Pod::Simple::BlackBox::BEGIN@24 at line 24 of Pod/Simple/BlackBox.pm # once (15µs+6µs) by Getopt::Long::BEGIN@47 at line 47 of Getopt/Long.pm # once (15µs+3µs) by Pod::Simple::LinkSection::BEGIN@8 at line 8 of Pod/Simple/LinkSection.pm # once (10µs+7µs) by Getopt::Long::BEGIN@27 at line 27 of Getopt/Long.pm # once (8µs+3µs) by Getopt::Long::BEGIN@20 at line 20 of Getopt/Long.pm # once (6µs+1000ns) by Getopt::Long::BEGIN@23 at line 23 of Getopt/Long.pm
sub import {
111611µs my $callpack = caller;
121620µs my (undef, @imports) = @_;
13161µs my ($sym, $ch);
141661µs foreach (@imports) {
1567248µs67103µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 103µs making 67 calls to vars::CORE:match, avg 2µs/call
1667232µs6732µs if ($sym =~ /\W/) {
# spent 32µs making 67 calls to vars::CORE:match, avg 478ns/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 }
2867149µs6718µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 18µs making 67 calls to vars::CORE:match, avg 269ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
3567195µ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 153µs within vars::CORE:match which was called 201 times, avg 761ns/call: # 67 times (103µs+0s) by vars::import at line 15, avg 2µs/call # 67 times (32µs+0s) by vars::import at line 16, avg 478ns/call # 67 times (18µs+0s) by vars::import at line 28, avg 269ns/call
sub vars::CORE:match; # opcode