← Index
NYTProf Performance Profile   « line view »
For ./move_planets.pl
  Run on Tue Jan 23 21:11:41 2024
Reported on Tue Jan 23 21:12:47 2024

Filename/usr/local/lib/perl5/5.36/vars.pm
StatementsExecuted 92 statements in 618µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
222176µs225µsvars::::importvars::import
573150µs50µsvars::::CORE:matchvars::CORE:match (opcode)
11115µs15µsvars::::BEGIN@3vars::BEGIN@3
1119µs30µsvars::::BEGIN@7vars::BEGIN@7
1115µ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
3261µs115µs
# spent 15µs within vars::BEGIN@3 which was called: # once (15µs+0s) by DynaLoader::BEGIN@28 at line 3
use 5.006;
# spent 15µs making 1 call to vars::BEGIN@3
4
51700nsour $VERSION = '1.05';
6
7226µs250µs
# spent 30µs (9+21) within vars::BEGIN@7 which was called: # once (9µs+21µs) by DynaLoader::BEGIN@28 at line 7
use warnings::register;
# spent 30µs making 1 call to vars::BEGIN@7 # spent 21µs making 1 call to warnings::register::import
82302µs216µs
# spent 11µs (5+5) within vars::BEGIN@8 which was called: # once (5µs+5µs) by DynaLoader::BEGIN@28 at line 8
use strict qw(vars subs);
# spent 11µs making 1 call to vars::BEGIN@8 # spent 5µs making 1 call to strict::import
9
10
# spent 225µs (176+50) within vars::import which was called 2 times, avg 113µs/call: # once (129µs+37µs) by DynaLoader::BEGIN@28 at line 30 of DynaLoader.pm # once (47µs+13µs) by DBI::Const::GetInfoType::BEGIN@16 at line 16 of DBI/Const/GetInfoType.pm
sub import {
1122µs my $callpack = caller;
1224µs my (undef, @imports) = @_;
132900ns my ($sym, $ch);
1429µs foreach (@imports) {
151983µs1929µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 29µs making 19 calls to vars::CORE:match, avg 2µs/call
161936µs1911µs if ($sym =~ /\W/) {
# spent 11µs making 19 calls to vars::CORE:match, avg 568ns/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 }
281946µs1910µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 10µs making 19 calls to vars::CORE:match, avg 532ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
351946µ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 50µs within vars::CORE:match which was called 57 times, avg 872ns/call: # 19 times (29µs+0s) by vars::import at line 15, avg 2µs/call # 19 times (11µs+0s) by vars::import at line 16, avg 568ns/call # 19 times (10µs+0s) by vars::import at line 28, avg 532ns/call
sub vars::CORE:match; # opcode