← Index
NYTProf Performance Profile   « line view »
For /usr/local/bin/sa-learn
  Run on Sun Nov 5 02:36:06 2017
Reported on Sun Nov 5 02:56:17 2017

Filename/usr/local/lib/perl5/5.24/mach/lib.pm
StatementsExecuted 62 statements in 1.70ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
222416µs602µslib::::importlib::import
21165µs65µslib::::CORE:ftislib::CORE:ftis (opcode)
74158µs58µslib::::CORE:ftdirlib::CORE:ftdir (opcode)
21151µs51µslib::::_get_dirslib::_get_dirs
11146µs97µslib::::BEGIN@6lib::BEGIN@6
11122µs34µslib::::BEGIN@8lib::BEGIN@8
21112µs12µ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
6262µs2148µs
# spent 97µs (46+51) within lib::BEGIN@6 which was called: # once (46µs+51µs) by main::BEGIN@39 at line 6
use Config;
# spent 97µs making 1 call to lib::BEGIN@6 # spent 51µs making 1 call to Config::import
7
82949µs247µs
# spent 34µs (22+12) within lib::BEGIN@8 which was called: # once (22µs+12µs) by main::BEGIN@39 at line 8
use strict;
# spent 34µs making 1 call to lib::BEGIN@8 # spent 12µs making 1 call to strict::import
9
10122µs114µsmy $archname = $Config{archname};
# spent 14µs making 1 call to Config::FETCH
11110µs18µsmy $version = $Config{version};
# spent 8µs making 1 call to Config::FETCH
12116µs18µsmy @inc_version_list = reverse split / /, $Config{inc_version_list};
# spent 8µs making 1 call to Config::FETCH
13
14
1513µsour @ORIG_INC = @INC; # take a handy copy of 'original' value
1612µsour $VERSION = '0.63';
17
18
# spent 602µs (416+186) within lib::import which was called 2 times, avg 301µs/call: # once (277µs+109µs) by main::BEGIN@39 at line 39 of /usr/local/bin/sa-learn # once (139µs+77µs) by Razor2::Client::Agent::BEGIN@13 at line 13 of Razor2/Client/Agent.pm
sub import {
1924µs shift;
20
2125µs my %names;
22210µs foreach (reverse @_) {
2326µs my $path = $_; # we'll be modifying it, so break the alias
2425µs if ($path eq '') {
25 require Carp;
26 Carp::carp("Empty compile time value given to use lib");
27 }
28
292282µs586µs if ($path !~ /\.par$/i && -e $path && ! -d _) {
# spent 65µs making 2 calls to lib::CORE:ftis, avg 33µs/call # spent 12µs making 2 calls to lib::CORE:match, avg 6µs/call # spent 8µs making 1 call to lib::CORE:ftdir
30 require Carp;
31 Carp::carp("Parameter to use lib must be directory, not file");
32 }
3329µs unshift(@INC, $path);
34 # Add any previous version directories we found at configure time
3529µs foreach my $incver (@inc_version_list)
36 {
37 my $dir = "$path/$incver";
38 unshift(@INC, $dir) if -d $dir;
39 }
40 # Put a corresponding archlib directory in front of $path if it
41 # looks like $path has an archlib directory below it.
42219µs251µs my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir)
# spent 51µs making 2 calls to lib::_get_dirs, avg 25µs/call
43 = _get_dirs($path);
44238µs223µs unshift(@INC, $arch_dir) if -d $arch_auto_dir;
# spent 23µs making 2 calls to lib::CORE:ftdir, avg 12µs/call
45230µs214µs unshift(@INC, $version_dir) if -d $version_dir;
# spent 14µs making 2 calls to lib::CORE:ftdir, avg 7µs/call
46232µs213µs unshift(@INC, $version_arch_dir) if -d $version_arch_dir;
# spent 13µs making 2 calls to lib::CORE:ftdir, avg 6µs/call
47 }
48
49 # remove trailing duplicates
501285µs @INC = grep { ++$names{$_} == 1 } @INC;
51221µs return;
52}
53
54
55sub unimport {
56 shift;
57
58 my %names;
59 foreach my $path (@_) {
60 my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir)
61 = _get_dirs($path);
62 ++$names{$path};
63 ++$names{$arch_dir} if -d $arch_auto_dir;
64 ++$names{$version_dir} if -d $version_dir;
65 ++$names{$version_arch_dir} if -d $version_arch_dir;
66 }
67
68 # Remove ALL instances of each named directory.
69 @INC = grep { !exists $names{$_} } @INC;
70 return;
71}
72
73
# spent 51µs within lib::_get_dirs which was called 2 times, avg 25µs/call: # 2 times (51µs+0s) by lib::import at line 42, avg 25µs/call
sub _get_dirs {
7425µs my($dir) = @_;
7523µs my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir);
76
7729µs $arch_auto_dir = "$dir/$archname/auto";
7826µs $arch_dir = "$dir/$archname";
7926µs $version_dir = "$dir/$version";
8027µs $version_arch_dir = "$dir/$version/$archname";
81
82219µs return($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir);
83}
84
85123µs1;
86__END__
 
# spent 58µs within lib::CORE:ftdir which was called 7 times, avg 8µs/call: # 2 times (23µs+0s) by lib::import at line 44, avg 12µs/call # 2 times (14µs+0s) by lib::import at line 45, avg 7µs/call # 2 times (13µs+0s) by lib::import at line 46, avg 6µs/call # once (8µs+0s) by lib::import at line 29
sub lib::CORE:ftdir; # opcode
# spent 65µs within lib::CORE:ftis which was called 2 times, avg 33µs/call: # 2 times (65µs+0s) by lib::import at line 29, avg 33µs/call
sub lib::CORE:ftis; # opcode
# spent 12µs within lib::CORE:match which was called 2 times, avg 6µs/call: # 2 times (12µs+0s) by lib::import at line 29, avg 6µs/call
sub lib::CORE:match; # opcode