← Index
NYTProf Performance Profile   « line view »
For /usr/local/bin/sa-learn
  Run on Sun Nov 5 03:09:29 2017
Reported on Mon Nov 6 13:20:45 2017

Filename/usr/local/lib/perl5/5.24/mach/lib.pm
StatementsExecuted 62 statements in 1.52ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
222350µs505µslib::::importlib::import
74153µs53µslib::::CORE:ftdirlib::CORE:ftdir (opcode)
21150µs50µslib::::_get_dirslib::_get_dirs
11143µs87µslib::::BEGIN@6lib::BEGIN@6
21141µs41µslib::::CORE:ftislib::CORE:ftis (opcode)
11121µs32µslib::::BEGIN@8lib::BEGIN@8
21110µs10µ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
6263µs2130µs
# spent 87µs (43+43) within lib::BEGIN@6 which was called: # once (43µs+43µs) by main::BEGIN@39 at line 6
use Config;
# spent 87µs making 1 call to lib::BEGIN@6 # spent 43µs making 1 call to Config::import
7
82884µs242µs
# spent 32µs (21+11) within lib::BEGIN@8 which was called: # once (21µs+11µs) by main::BEGIN@39 at line 8
use strict;
# spent 32µs making 1 call to lib::BEGIN@8 # spent 11µs making 1 call to strict::import
9
10118µs112µsmy $archname = $Config{archname};
# spent 12µs making 1 call to Config::FETCH
1119µs17µsmy $version = $Config{version};
# spent 7µs making 1 call to Config::FETCH
12114µ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 505µs (350+155) within lib::import which was called 2 times, avg 252µs/call: # once (230µs+91µs) by main::BEGIN@39 at line 39 of /usr/local/bin/sa-learn # once (120µs+64µs) by Razor2::Client::Agent::BEGIN@13 at line 13 of Razor2/Client/Agent.pm
sub import {
1924µs shift;
20
2124µs my %names;
22210µs foreach (reverse @_) {
2324µ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
292208µs558µs if ($path !~ /\.par$/i && -e $path && ! -d _) {
# spent 41µs making 2 calls to lib::CORE:ftis, avg 21µs/call # spent 10µs making 2 calls to lib::CORE:match, avg 5µs/call # spent 6µ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µs250µs my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir)
# spent 50µs making 2 calls to lib::_get_dirs, avg 25µs/call
43 = _get_dirs($path);
44234µs219µs unshift(@INC, $arch_dir) if -d $arch_auto_dir;
# spent 19µs making 2 calls to lib::CORE:ftdir, avg 10µs/call
45231µs214µs unshift(@INC, $version_dir) if -d $version_dir;
# spent 14µs making 2 calls to lib::CORE:ftdir, avg 7µs/call
46233µs214µs unshift(@INC, $version_arch_dir) if -d $version_arch_dir;
# spent 14µs making 2 calls to lib::CORE:ftdir, avg 7µs/call
47 }
48
49 # remove trailing duplicates
501268µ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 50µs within lib::_get_dirs which was called 2 times, avg 25µs/call: # 2 times (50µs+0s) by lib::import at line 42, avg 25µs/call
sub _get_dirs {
7425µs my($dir) = @_;
7524µs my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir);
76
7728µ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
85114µs1;
86__END__
 
# spent 53µs within lib::CORE:ftdir which was called 7 times, avg 8µs/call: # 2 times (19µs+0s) by lib::import at line 44, avg 10µs/call # 2 times (14µs+0s) by lib::import at line 45, avg 7µs/call # 2 times (14µs+0s) by lib::import at line 46, avg 7µs/call # once (6µs+0s) by lib::import at line 29
sub lib::CORE:ftdir; # opcode
# spent 41µs within lib::CORE:ftis which was called 2 times, avg 21µs/call: # 2 times (41µs+0s) by lib::import at line 29, avg 21µs/call
sub lib::CORE:ftis; # opcode
# spent 10µs within lib::CORE:match which was called 2 times, avg 5µs/call: # 2 times (10µs+0s) by lib::import at line 29, avg 5µs/call
sub lib::CORE:match; # opcode