← 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:19 2015

Filename/usr/lib/perl/5.14/lib.pm
StatementsExecuted 73 statements in 2.43ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
3111.47ms1.47mslib::::CORE:ftislib::CORE:ftis (opcode)
1241469µs469µslib::::CORE:ftdirlib::CORE:ftdir (opcode)
333112µs2.08mslib::::importlib::import
31127µs27µslib::::_get_dirslib::_get_dirs
1119µs15µslib::::BEGIN@6lib::BEGIN@6
1114µs6µslib::::BEGIN@8lib::BEGIN@8
3113µs3µslib::::CORE:matchlib::CORE:match (opcode)
0000s0slib::::unimportlib::unimport
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package lib;
2
3# THIS FILE IS AUTOMATICALLY GENERATED FROM lib_pm.PL.
4# ANY CHANGES TO THIS FILE WILL BE OVERWRITTEN BY THE NEXT PERL BUILD.
5
6220µs222µs
# spent 15µs (9+6) within lib::BEGIN@6 which was called: # once (9µs+6µs) by NewBoard::BEGIN@23 at line 6
use Config;
# spent 15µs making 1 call to lib::BEGIN@6 # spent 6µs making 1 call to Config::import
7
82314µs28µs
# spent 6µs (4+2) within lib::BEGIN@8 which was called: # once (4µs+2µs) by NewBoard::BEGIN@23 at line 8
use strict;
# spent 6µs making 1 call to lib::BEGIN@8 # spent 2µs making 1 call to strict::import
9
1014µs12µsmy $archname = $Config{archname};
# spent 2µs making 1 call to Config::FETCH
1112µs11µsmy $version = $Config{version};
# spent 1µs making 1 call to Config::FETCH
1212µs11µsmy @inc_version_list = reverse split / /, $Config{inc_version_list};
# spent 1µs making 1 call to Config::FETCH
13
1411µsour @ORIG_INC = @INC; # take a handy copy of 'original' value
151200nsour $VERSION = '0.63';
16
17
# spent 2.08ms (112µs+1.96) within lib::import which was called 3 times, avg 692µs/call: # once (75µs+1.93ms) by NewBoard::BEGIN@23 at line 23 of NewBoard.pm # once (19µs+16µs) by main::BEGIN@17 at line 17 of NewIncNPlyPicker.pm # once (18µs+15µs) by main::BEGIN@9.10 at line 9 of NewSolveGame.pm
sub import {
183300ns shift;
19
203300ns my %names;
2132µs foreach (reverse @_) {
223800ns my $path = $_; # we'll be modifying it, so break the alias
233400ns if ($path eq '') {
24 require Carp;
25 Carp::carp("Empty compile time value given to use lib");
26 }
27
2831.50ms91.47ms if ($path !~ /\.par$/i && -e $path && ! -d _) {
# spent 1.47ms making 3 calls to lib::CORE:ftis, avg 489µs/call # spent 3µs making 3 calls to lib::CORE:match, avg 1µs/call # spent 1µs making 3 calls to lib::CORE:ftdir, avg 467ns/call
29 require Carp;
30 Carp::carp("Parameter to use lib must be directory, not file");
31 }
3234µs unshift(@INC, $path);
33 # Add any previous version directories we found at configure time
3434µs foreach my $incver (@inc_version_list)
35 {
36 my $dir = "$path/$incver";
37 unshift(@INC, $dir) if -d $dir;
38 }
39 # Put a corresponding archlib directory in front of $path if it
40 # looks like $path has an archlib directory below it.
4137µs327µs my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir)
# spent 27µs making 3 calls to lib::_get_dirs, avg 9µs/call
42 = _get_dirs($path);
433457µs3448µs unshift(@INC, $arch_dir) if -d $arch_auto_dir;
# spent 448µs making 3 calls to lib::CORE:ftdir, avg 149µs/call
44316µs312µs unshift(@INC, $version_dir) if -d $version_dir;
# spent 12µs making 3 calls to lib::CORE:ftdir, avg 4µs/call
45316µs38µs unshift(@INC, $version_arch_dir) if -d $version_arch_dir;
# spent 8µs making 3 calls to lib::CORE:ftdir, avg 3µs/call
46 }
47
48 # remove trailing duplicates
49331µs @INC = grep { ++$names{$_} == 1 } @INC;
5038µs return;
51}
52
53sub unimport {
54 shift;
55
56 my %names;
57 foreach my $path (@_) {
58 my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir)
59 = _get_dirs($path);
60 ++$names{$path};
61 ++$names{$arch_dir} if -d $arch_auto_dir;
62 ++$names{$version_dir} if -d $version_dir;
63 ++$names{$version_arch_dir} if -d $version_arch_dir;
64 }
65
66 # Remove ALL instances of each named directory.
67 @INC = grep { !exists $names{$_} } @INC;
68 return;
69}
70
71
# spent 27µs within lib::_get_dirs which was called 3 times, avg 9µs/call: # 3 times (27µs+0s) by lib::import at line 41, avg 9µs/call
sub _get_dirs {
7232µs my($dir) = @_;
733800ns my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir);
74
7534µs $arch_auto_dir = "$dir/$archname/auto";
7631µs $arch_dir = "$dir/$archname";
7731µs $version_dir = "$dir/$version";
7832µs $version_arch_dir = "$dir/$version/$archname";
79
80317µs return($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir);
81}
82
8315µs1;
84__END__
 
# spent 469µs within lib::CORE:ftdir which was called 12 times, avg 39µs/call: # 3 times (448µs+0s) by lib::import at line 43, avg 149µs/call # 3 times (12µs+0s) by lib::import at line 44, avg 4µs/call # 3 times (8µs+0s) by lib::import at line 45, avg 3µs/call # 3 times (1µs+0s) by lib::import at line 28, avg 467ns/call
sub lib::CORE:ftdir; # opcode
# spent 1.47ms within lib::CORE:ftis which was called 3 times, avg 489µs/call: # 3 times (1.47ms+0s) by lib::import at line 28, avg 489µs/call
sub lib::CORE:ftis; # opcode
# spent 3µs within lib::CORE:match which was called 3 times, avg 1µs/call: # 3 times (3µs+0s) by lib::import at line 28, avg 1µs/call
sub lib::CORE:match; # opcode