← Index
NYTProf Performance Profile   « line view »
For examples/Atom-timer.pl
  Run on Mon Aug 12 14:45:28 2013
Reported on Mon Aug 12 14:46:14 2013

Filename/Users/dde/perl5/perlbrew/perls/5.18.0t/lib/5.18.0/darwin-thread-multi-2level/lib.pm
StatementsExecuted 68 statements in 558µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111551µs1.28mslib::::BEGIN@6lib::BEGIN@6
22272µs117µslib::::importlib::import
31116µs16µslib::::_get_dirslib::_get_dirs
31113µs13µslib::::CORE:ftislib::CORE:ftis (opcode)
124113µs13µslib::::CORE:ftdirlib::CORE:ftdir (opcode)
1115µs15µslib::::BEGIN@8lib::BEGIN@8
3113µs3µ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
6288µs21.29ms
# spent 1.28ms (551µs+732µs) within lib::BEGIN@6 which was called: # once (551µs+732µs) by main::BEGIN@2 at line 6
use Config;
# spent 1.28ms making 1 call to lib::BEGIN@6 # spent 8µs making 1 call to Config::import
7
82341µs224µs
# spent 15µs (5+10) within lib::BEGIN@8 which was called: # once (5µs+10µs) by main::BEGIN@2 at line 8
use strict;
# spent 15µs making 1 call to lib::BEGIN@8 # spent 10µs making 1 call to strict::import
9
1015µs13µsmy $archname = $Config{archname};
# spent 3µs making 1 call to Config::FETCH
1113µs12µsmy $version = $Config{version};
# spent 2µs making 1 call to Config::FETCH
1213µs12µsmy @inc_version_list = reverse split / /, $Config{inc_version_list};
# spent 2µs making 1 call to Config::FETCH
13
14
1511µsour @ORIG_INC = @INC; # take a handy copy of 'original' value
161200nsour $VERSION = '0.63';
17
18
# spent 117µs (72+45) within lib::import which was called 2 times, avg 58µs/call: # once (41µs+28µs) by Atom::BEGIN@4 at line 4 of lib/HackaMol/Atom.pm # once (31µs+17µs) by main::BEGIN@2 at line 2 of examples/Atom-timer.pl
sub import {
192300ns shift;
20
212300ns my %names;
2222µs foreach (reverse @_) {
2331µs my $path = $_; # we'll be modifying it, so break the alias
243900ns if ($path eq '') {
25 require Carp;
26 Carp::carp("Empty compile time value given to use lib");
27 }
28
29336µs917µs if ($path !~ /\.par$/i && -e $path && ! -d _) {
# spent 13µs making 3 calls to lib::CORE:ftis, avg 4µs/call # spent 3µs making 3 calls to lib::CORE:match, avg 1µs/call # spent 900ns making 3 calls to lib::CORE:ftdir, avg 300ns/call
30 require Carp;
31 Carp::carp("Parameter to use lib must be directory, not file");
32 }
3333µs unshift(@INC, $path);
34 # Add any previous version directories we found at configure time
3532µ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.
4235µs316µs my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir)
# spent 16µs making 3 calls to lib::_get_dirs, avg 5µs/call
43 = _get_dirs($path);
44310µs36µs unshift(@INC, $arch_dir) if -d $arch_auto_dir;
# spent 6µs making 3 calls to lib::CORE:ftdir, avg 2µs/call
4537µs34µs unshift(@INC, $version_dir) if -d $version_dir;
# spent 4µs making 3 calls to lib::CORE:ftdir, avg 1µs/call
4638µs33µs unshift(@INC, $version_arch_dir) if -d $version_arch_dir;
# spent 3µs making 3 calls to lib::CORE:ftdir, avg 867ns/call
47 }
48
49 # remove trailing duplicates
50213µs @INC = grep { ++$names{$_} == 1 } @INC;
5127µ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 16µs within lib::_get_dirs which was called 3 times, avg 5µs/call: # 3 times (16µs+0s) by lib::import at line 42, avg 5µs/call
sub _get_dirs {
7431µs my($dir) = @_;
753300ns my($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir);
76
7732µs $arch_auto_dir = "$dir/$archname/auto";
7831µs $arch_dir = "$dir/$archname";
793800ns $version_dir = "$dir/$version";
8032µs $version_arch_dir = "$dir/$version/$archname";
81
8237µs return($arch_auto_dir, $arch_dir, $version_dir, $version_arch_dir);
83}
84
8515µs1;
86__END__
 
# spent 13µs within lib::CORE:ftdir which was called 12 times, avg 1µs/call: # 3 times (6µs+0s) by lib::import at line 44, avg 2µs/call # 3 times (4µs+0s) by lib::import at line 45, avg 1µs/call # 3 times (3µs+0s) by lib::import at line 46, avg 867ns/call # 3 times (900ns+0s) by lib::import at line 29, avg 300ns/call
sub lib::CORE:ftdir; # opcode
# spent 13µs within lib::CORE:ftis which was called 3 times, avg 4µs/call: # 3 times (13µs+0s) by lib::import at line 29, avg 4µs/call
sub lib::CORE:ftis; # opcode
# spent 3µs within lib::CORE:match which was called 3 times, avg 1µs/call: # 3 times (3µs+0s) by lib::import at line 29, avg 1µs/call
sub lib::CORE:match; # opcode