← Index
NYTProf Performance Profile   « line view »
For /usr/local/bin/sa-learn
  Run on Tue Nov 7 05:38:10 2017
Reported on Tue Nov 7 06:16:00 2017

Filename/usr/local/lib/perl5/5.24/mach/lib.pm
StatementsExecuted 62 statements in 1.72ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
222395µs581µslib::::importlib::import
21169µs69µslib::::_get_dirslib::_get_dirs
74160µs60µslib::::CORE:ftdirlib::CORE:ftdir (opcode)
11152µs94µslib::::BEGIN@6lib::BEGIN@6
21133µs33µslib::::CORE:ftislib::CORE:ftis (opcode)
21124µs24µslib::::CORE:matchlib::CORE:match (opcode)
11122µs32µslib::::BEGIN@8lib::BEGIN@8
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
6289µs2137µs
# spent 94µs (52+42) within lib::BEGIN@6 which was called: # once (52µs+42µs) by main::BEGIN@39 at line 6
use Config;
# spent 94µs making 1 call to lib::BEGIN@6 # spent 42µs making 1 call to Config::import
7
82969µs243µs
# spent 32µs (22+11) within lib::BEGIN@8 which was called: # once (22µ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
11110µs110µsmy $version = $Config{version};
# spent 10µs making 1 call to Config::FETCH
12119µs110µsmy @inc_version_list = reverse split / /, $Config{inc_version_list};
# spent 10µ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 581µs (395+186) within lib::import which was called 2 times, avg 290µs/call: # once (253µs+133µs) by main::BEGIN@39 at line 39 of /usr/local/bin/sa-learn # once (142µs+54µs) by Razor2::Client::Agent::BEGIN@13 at line 13 of Razor2/Client/Agent.pm
sub import {
1924µs shift;
20
2127µs my %names;
2229µs foreach (reverse @_) {
2324µs my $path = $_; # we'll be modifying it, so break the alias
2426µs if ($path eq '') {
25 require Carp;
26 Carp::carp("Empty compile time value given to use lib");
27 }
28
292214µs562µs if ($path !~ /\.par$/i && -e $path && ! -d _) {
# spent 33µs making 2 calls to lib::CORE:ftis, avg 17µs/call # spent 24µs making 2 calls to lib::CORE:match, avg 12µs/call # spent 5µ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.
42218µs269µs my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir)
# spent 69µs making 2 calls to lib::_get_dirs, avg 35µs/call
43 = _get_dirs($path);
44243µs229µs unshift(@INC, $arch_dir) if -d $arch_auto_dir;
# spent 29µs making 2 calls to lib::CORE:ftdir, avg 14µ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
46237µ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
5012100µ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 69µs within lib::_get_dirs which was called 2 times, avg 35µs/call: # 2 times (69µs+0s) by lib::import at line 42, avg 35µs/call
sub _get_dirs {
7425µs my($dir) = @_;
7524µs my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir);
76
77218µ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
82232µs return($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir);
83}
84
85120µs1;
86__END__
 
# spent 60µs within lib::CORE:ftdir which was called 7 times, avg 9µs/call: # 2 times (29µs+0s) by lib::import at line 44, avg 14µ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 (5µs+0s) by lib::import at line 29
sub lib::CORE:ftdir; # opcode
# spent 33µs within lib::CORE:ftis which was called 2 times, avg 17µs/call: # 2 times (33µs+0s) by lib::import at line 29, avg 17µs/call
sub lib::CORE:ftis; # opcode
# spent 24µs within lib::CORE:match which was called 2 times, avg 12µs/call: # 2 times (24µs+0s) by lib::import at line 29, avg 12µs/call
sub lib::CORE:match; # opcode