← Index
NYTProf Performance Profile   « line view »
For scripts/bench.pl
  Run on Mon Oct 22 16:48:56 2018
Reported on Mon Oct 22 16:49:10 2018

Filename/usr/share/perl/5.26/vars.pm
StatementsExecuted 20 statements in 1.45ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111442µs620µsvars::::BEGIN@7vars::BEGIN@7
11162µs78µsvars::::importvars::import
11130µs30µsvars::::BEGIN@3vars::BEGIN@3
63115µs15µsvars::::CORE:matchvars::CORE:match (opcode)
11113µs36µ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
32114µs130µs
# spent 30µs within vars::BEGIN@3 which was called: # once (30µs+0s) by Config::BEGIN@11 at line 3
use 5.006;
# spent 30µs making 1 call to vars::BEGIN@3
4
511µsour $VERSION = '1.03';
6
72485µs2797µs
# spent 620µs (442+177) within vars::BEGIN@7 which was called: # once (442µs+177µs) by Config::BEGIN@11 at line 7
use warnings::register;
# spent 620µs making 1 call to vars::BEGIN@7 # spent 177µs making 1 call to warnings::register::import
82759µs260µs
# spent 36µs (13+24) within vars::BEGIN@8 which was called: # once (13µs+24µs) by Config::BEGIN@11 at line 8
use strict qw(vars subs);
# spent 36µs making 1 call to vars::BEGIN@8 # spent 24µs making 1 call to strict::import
9
10
# spent 78µs (62+15) within vars::import which was called: # once (62µs+15µs) by Config::BEGIN@11 at line 11 of Config.pm
sub import {
1112µs my $callpack = caller;
1213µs my (undef, @imports) = @_;
131500ns my ($sym, $ch);
1417µs foreach (@imports) {
15234µs210µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 10µs making 2 calls to vars::CORE:match, avg 5µs/call
1629µs23µs if ($sym =~ /\W/) {
# spent 3µs making 2 calls to vars::CORE:match, avg 2µs/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 }
2829µs22µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 2µs making 2 calls to vars::CORE:match, avg 900ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
35215µ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
4618µs1;
47__END__
 
# spent 15µs within vars::CORE:match which was called 6 times, avg 3µs/call: # 2 times (10µs+0s) by vars::import at line 15, avg 5µs/call # 2 times (3µs+0s) by vars::import at line 16, avg 2µs/call # 2 times (2µs+0s) by vars::import at line 28, avg 900ns/call
sub vars::CORE:match; # opcode