← Index
NYTProf Performance Profile   « line view »
For opt.pl
  Run on Wed May 13 13:47:05 2015
Reported on Wed May 13 13:47:06 2015

Filename/home/lbr/.plenv/versions/5.20.2/lib/perl5/5.20.2/x86_64-linux/lib.pm
StatementsExecuted 31 statements in 432µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111482µs3.32mslib::::BEGIN@6lib::BEGIN@6
11128µs39µ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)
4413µs3µslib::::CORE:ftdirlib::CORE:ftdir (opcode)
111400ns400nslib::::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
6291µs23.33ms
# spent 3.32ms (482µs+2.84) within lib::BEGIN@6 which was called: # once (482µs+2.84ms) by main::BEGIN@1 at line 6
use Config;
# spent 3.32ms making 1 call to lib::BEGIN@6 # spent 8µs making 1 call to Config::import
7
82283µs223µs
# spent 14µs (5+9) within lib::BEGIN@8 which was called: # once (5µs+9µs) by main::BEGIN@1 at line 8
use strict;
# spent 14µs making 1 call to lib::BEGIN@8 # spent 9µs making 1 call to strict::import
9
1015µ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µs1800nsmy @inc_version_list = reverse split / /, $Config{inc_version_list};
# spent 800ns 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 39µs (28+11) within lib::import which was called: # once (28µs+11µ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 600ns making 1 call to lib::CORE:ftdir # spent 400ns 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
351700ns 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.
4211µ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);
4413µs11µs unshift(@INC, $arch_dir) if -d $arch_auto_dir;
# spent 1µs making 1 call to lib::CORE:ftdir
4512µs1600ns unshift(@INC, $version_dir) if -d $version_dir;
# spent 600ns making 1 call to lib::CORE:ftdir
4615µ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) = @_;
751100ns my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir);
76
7711µs $arch_auto_dir = "$dir/$archname/auto";
781500ns $arch_dir = "$dir/$archname";
791500ns $version_dir = "$dir/$version";
801600ns $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 3µs within lib::CORE:ftdir which was called 4 times, avg 700ns/call: # once (1µs+0s) by lib::import at line 44 # once (600ns+0s) by lib::import at line 45 # once (600ns+0s) by lib::import at line 29 # 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 400ns within lib::CORE:match which was called: # once (400ns+0s) by lib::import at line 29
sub lib::CORE:match; # opcode