← Index
NYTProf Performance Profile   « line view »
For opt.pl
  Run on Tue May 12 15:32:29 2015
Reported on Tue May 12 15:32:30 2015

Filename/home/lbr/.plenv/versions/5.20.2/lib/perl5/5.20.2/x86_64-linux/lib.pm
StatementsExecuted 31 statements in 412µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111493µs3.16mslib::::BEGIN@6lib::BEGIN@6
11129µs41µslib::::importlib::import
1115µs14µslib::::BEGIN@8lib::BEGIN@8
1114µs4µslib::::_get_dirslib::_get_dirs
1114µs4µslib::::CORE:ftislib::CORE:ftis (opcode)
4414µs4µslib::::CORE:ftdirlib::CORE:ftdir (opcode)
111300ns300nslib::::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
6264µs23.17ms
# spent 3.16ms (493µs+2.67) within lib::BEGIN@6 which was called: # once (493µs+2.67ms) by main::BEGIN@1 at line 6
use Config;
# spent 3.16ms making 1 call to lib::BEGIN@6 # spent 8µs making 1 call to Config::import
7
82287µs224µs
# spent 14µs (5+10) within lib::BEGIN@8 which was called: # once (5µs+10µs) by main::BEGIN@1 at line 8
use strict;
# spent 14µs making 1 call to lib::BEGIN@8 # spent 10µs making 1 call to strict::import
9
1016µs13µsmy $archname = $Config{archname};
# spent 3µs making 1 call to Config::FETCH
1112µs11µsmy $version = $Config{version};
# spent 1µs making 1 call to Config::FETCH
1213µs11µsmy @inc_version_list = reverse split / /, $Config{inc_version_list};
# spent 1µs making 1 call to Config::FETCH
13
14
151900nsour @ORIG_INC = @INC; # take a handy copy of 'original' value
161200nsour $VERSION = '0.63';
17
18
# spent 41µs (29+12) within lib::import which was called: # once (29µs+12µs) by main::BEGIN@1 at line 1 of opt.pl
sub import {
191200ns shift;
20
211200ns my %names;
221900ns foreach (reverse @_) {
231300ns my $path = $_; # we'll be modifying it, so break the alias
241300ns if ($path eq '') {
25 require Carp;
26 Carp::carp("Empty compile time value given to use lib");
27 }
28
29113µs35µs if ($path !~ /\.par$/i && -e $path && ! -d _) {
# spent 4µs making 1 call to lib::CORE:ftis # spent 700ns making 1 call to lib::CORE:ftdir # spent 300ns making 1 call to lib::CORE:match
30 require Carp;
31 Carp::carp("Parameter to use lib must be directory, not file");
32 }
331800ns unshift(@INC, $path);
34 # Add any previous version directories we found at configure time
351600ns 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.
4212µs14µs my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir)
# spent 4µs making 1 call to lib::_get_dirs
43 = _get_dirs($path);
4414µs12µs unshift(@INC, $arch_dir) if -d $arch_auto_dir;
# spent 2µs making 1 call to lib::CORE:ftdir
4512µs1500ns unshift(@INC, $version_dir) if -d $version_dir;
# spent 500ns making 1 call to lib::CORE:ftdir
4616µs1400ns unshift(@INC, $version_arch_dir) if -d $version_arch_dir;
# spent 400ns making 1 call to lib::CORE:ftdir
47 }
48
49 # remove trailing duplicates
5015µs @INC = grep { ++$names{$_} == 1 } @INC;
5115µ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 4µs within lib::_get_dirs which was called: # once (4µs+0s) by lib::import at line 42
sub _get_dirs {
741300ns my($dir) = @_;
751200ns my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir);
76
771800ns $arch_auto_dir = "$dir/$archname/auto";
781600ns $arch_dir = "$dir/$archname";
791400ns $version_dir = "$dir/$version";
801700ns $version_arch_dir = "$dir/$version/$archname";
81
8212µs return($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir);
83}
84
8515µs1;
86__END__
 
# spent 4µs within lib::CORE:ftdir which was called 4 times, avg 875ns/call: # once (2µs+0s) by lib::import at line 44 # once (700ns+0s) by lib::import at line 29 # once (500ns+0s) by lib::import at line 45 # once (400ns+0s) by lib::import at line 46
sub lib::CORE:ftdir; # opcode
# spent 4µs within lib::CORE:ftis which was called: # once (4µs+0s) by lib::import at line 29
sub lib::CORE:ftis; # opcode
# spent 300ns within lib::CORE:match which was called: # once (300ns+0s) by lib::import at line 29
sub lib::CORE:match; # opcode