← Index
NYTProf Performance Profile   « block view • line view • sub view »
For ./testnewboardincnply
  Run on Mon Jan 12 21:52:27 2015
Reported on Mon Jan 12 22:01:18 2015

Filename/usr/share/perl/5.14/vars.pm
StatementsExecuted 200 statements in 588µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
10105254µs314µsvars::::importvars::import
1143159µs59µsvars::::CORE:matchvars::CORE:match (opcode)
11111µs11µsvars::::BEGIN@3vars::BEGIN@3
1115µs49µsvars::::BEGIN@7vars::BEGIN@7
1114µ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
3242µs111µs
# spent 11µs within vars::BEGIN@3 which was called: # once (11µs+0s) by Getopt::Long::BEGIN@19 at line 3
use 5.006;
# spent 11µs making 1 call to vars::BEGIN@3
4
51400nsour $VERSION = '1.02';
6
7220µs294µs
# spent 49µs (5+44) within vars::BEGIN@7 which was called: # once (5µs+44µs) by Getopt::Long::BEGIN@19 at line 7
use warnings::register;
# spent 49µs making 1 call to vars::BEGIN@7 # spent 44µs making 1 call to warnings::register::import
82201µs219µs
# spent 11µs (4+7) within vars::BEGIN@8 which was called: # once (4µs+7µs) by Getopt::Long::BEGIN@19 at line 8
use strict qw(vars subs);
# spent 11µs making 1 call to vars::BEGIN@8 # spent 7µs making 1 call to strict::import
9
10
# spent 314µs (254+59) within vars::import which was called 10 times, avg 31µs/call: # once (59µs+12µs) by Getopt::Long::BEGIN@45 at line 45 of Getopt/Long.pm # once (36µs+8µs) by Getopt::Long::BEGIN@51 at line 51 of Getopt/Long.pm # once (34µs+8µs) by Getopt::Long::BEGIN@48 at line 48 of Getopt/Long.pm # once (31µs+8µs) by Clone::BEGIN@6 at line 6 of Clone.pm # once (26µs+5µs) by Getopt::Long::BEGIN@46 at line 46 of Getopt/Long.pm # once (21µs+5µs) by Getopt::Long::BEGIN@26 at line 26 of Getopt/Long.pm # once (15µs+4µs) by constant::BEGIN@6 at line 6 of constant.pm # once (13µs+3µs) by Getopt::Long::BEGIN@19 at line 19 of Getopt/Long.pm # once (11µs+3µs) by parent::BEGIN@3 at line 3 of parent.pm # once (9µs+3µs) by Config::BEGIN@11 at line 11 of Config.pm
sub import {
11192323µs my $callpack = caller;
12 my (undef, @imports) = @_;
13 my ($sym, $ch);
14 foreach (@imports) {
153841µs if (($ch, $sym) = /^([\$\@\%\*\&])(.+)/) {
# spent 41µs making 38 calls to vars::CORE:match, avg 1µs/call
163810µs if ($sym =~ /\W/) {
# spent 10µs making 38 calls to vars::CORE:match, avg 258ns/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 }
28388µs $sym = "${callpack}::$sym" unless $sym =~ /::/;
# spent 8µs making 38 calls to vars::CORE:match, avg 216ns/call
29 *$sym =
30 ( $ch eq "\$" ? \$$sym
31 : $ch eq "\@" ? \@$sym
32 : $ch eq "\%" ? \%$sym
33 : $ch eq "\*" ? \*$sym
34 : $ch eq "\&" ? \&$sym
35 : 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
4612µs1;
47__END__
 
# spent 59µs within vars::CORE:match which was called 114 times, avg 519ns/call: # 38 times (41µs+0s) by vars::import at line 15, avg 1µs/call # 38 times (10µs+0s) by vars::import at line 16, avg 258ns/call # 38 times (8µs+0s) by vars::import at line 28, avg 216ns/call
sub vars::CORE:match; # opcode