Filename | /usr/lib/perl/5.14/lib.pm |
Statements | Executed 73 statements in 2.43ms |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
3 | 1 | 1 | 1.47ms | 1.47ms | CORE:ftis (opcode) | lib::
12 | 4 | 1 | 469µs | 469µs | CORE:ftdir (opcode) | lib::
3 | 3 | 3 | 112µs | 2.08ms | import | lib::
3 | 1 | 1 | 27µs | 27µs | _get_dirs | lib::
1 | 1 | 1 | 9µs | 15µs | BEGIN@6 | lib::
1 | 1 | 1 | 4µs | 6µs | BEGIN@8 | lib::
3 | 1 | 1 | 3µs | 3µs | CORE:match (opcode) | lib::
0 | 0 | 0 | 0s | 0s | unimport | lib::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package 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 | |||||
6 | 2 | 20µs | 2 | 22µ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 # spent 15µs making 1 call to lib::BEGIN@6
# spent 6µs making 1 call to Config::import |
7 | |||||
8 | 2 | 314µs | 2 | 8µ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 # spent 6µs making 1 call to lib::BEGIN@8
# spent 2µs making 1 call to strict::import |
9 | |||||
10 | 1 | 4µs | 1 | 2µs | my $archname = $Config{archname}; # spent 2µs making 1 call to Config::FETCH |
11 | 1 | 2µs | 1 | 1µs | my $version = $Config{version}; # spent 1µs making 1 call to Config::FETCH |
12 | 1 | 2µs | 1 | 1µs | my @inc_version_list = reverse split / /, $Config{inc_version_list}; # spent 1µs making 1 call to Config::FETCH |
13 | |||||
14 | 1 | 1µs | our @ORIG_INC = @INC; # take a handy copy of 'original' value | ||
15 | 1 | 200ns | our $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 | ||||
18 | 15 | 43µs | shift; | ||
19 | |||||
20 | my %names; | ||||
21 | foreach (reverse @_) { | ||||
22 | 27 | 2.01ms | my $path = $_; # we'll be modifying it, so break the alias | ||
23 | if ($path eq '') { | ||||
24 | require Carp; | ||||
25 | Carp::carp("Empty compile time value given to use lib"); | ||||
26 | } | ||||
27 | |||||
28 | 9 | 1.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 | } | ||||
32 | unshift(@INC, $path); | ||||
33 | # Add any previous version directories we found at configure time | ||||
34 | 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. | ||||
41 | 3 | 27µ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); | ||||
43 | 3 | 448µs | unshift(@INC, $arch_dir) if -d $arch_auto_dir; # spent 448µs making 3 calls to lib::CORE:ftdir, avg 149µs/call | ||
44 | 3 | 12µs | unshift(@INC, $version_dir) if -d $version_dir; # spent 12µs making 3 calls to lib::CORE:ftdir, avg 4µs/call | ||
45 | 3 | 8µ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 | ||||
49 | @INC = grep { ++$names{$_} == 1 } @INC; | ||||
50 | return; | ||||
51 | } | ||||
52 | |||||
53 | sub 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 | ||||
72 | 21 | 28µs | my($dir) = @_; | ||
73 | my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir); | ||||
74 | |||||
75 | $arch_auto_dir = "$dir/$archname/auto"; | ||||
76 | $arch_dir = "$dir/$archname"; | ||||
77 | $version_dir = "$dir/$version"; | ||||
78 | $version_arch_dir = "$dir/$version/$archname"; | ||||
79 | |||||
80 | return($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir); | ||||
81 | } | ||||
82 | |||||
83 | 1 | 5µs | 1; | ||
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 | |||||
# 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 | |||||
# 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 |