← Index
NYTProf Performance Profile   « line view »
For Makefile.PL
  Run on Sun Mar 1 16:04:44 2015
Reported on Sun Mar 1 16:09:02 2015

FilenameC:/tmp64ng/perl/vendor/lib/Portable/Config.pm
StatementsExecuted 2943 statements in 31.2ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11115.6ms62.4msPortable::Config::::applyPortable::Config::apply
1110s0sPortable::Config::::BEGIN@3Portable::Config::BEGIN@3
1110s0sPortable::Config::::BEGIN@4Portable::Config::BEGIN@4
1110s0sPortable::Config::::BEGIN@5Portable::Config::BEGIN@5
1110s0sPortable::Config::::BEGIN@6Portable::Config::BEGIN@6
1110s0sPortable::Config::::BEGIN@64Portable::Config::BEGIN@64
1110s0sPortable::Config::::BEGIN@78Portable::Config::BEGIN@78
1455410s0sPortable::Config::::CORE:matchPortable::Config::CORE:match (opcode)
686110s0sPortable::Config::::CORE:regcompPortable::Config::CORE:regcomp (opcode)
3310s0sPortable::Config::::CORE:sortPortable::Config::CORE:sort (opcode)
5110s0sPortable::Config::::CORE:substPortable::Config::CORE:subst (opcode)
13110s0sPortable::Config::::CORE:substcontPortable::Config::CORE:substcont (opcode)
79110s0sPortable::Config::::__ANON__[:68]Portable::Config::__ANON__[:68]
1110s0sPortable::Config::::newPortable::Config::new
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Portable::Config;
2
320s10s
# spent 0s within Portable::Config::BEGIN@3 which was called: # once (0s+0s) by Portable::new at line 3
use 5.008;
# spent 0s making 1 call to Portable::Config::BEGIN@3
420s20s
# spent 0s within Portable::Config::BEGIN@4 which was called: # once (0s+0s) by Portable::new at line 4
use strict;
# spent 0s making 1 call to Portable::Config::BEGIN@4 # spent 0s making 1 call to strict::import
520s20s
# spent 0s within Portable::Config::BEGIN@5 which was called: # once (0s+0s) by Portable::new at line 5
use warnings;
# spent 0s making 1 call to Portable::Config::BEGIN@5 # spent 0s making 1 call to warnings::import
620s10s
# spent 0s within Portable::Config::BEGIN@6 which was called: # once (0s+0s) by Portable::new at line 6
use Portable::FileSpec;
# spent 0s making 1 call to Portable::Config::BEGIN@6
7
810sour $VERSION = '1.22';
9
10#####################################################################
11# Constructor
12
13
# spent 0s within Portable::Config::new which was called: # once (0s+0s) by Portable::new at line 153 of Portable.pm
sub new {
1410s my $class = shift;
1510s my $parent = shift;
1610s20s unless ( Portable::_HASH($parent->portable_config) ) {
# spent 0s making 1 call to Portable::_HASH # spent 0s making 1 call to Portable::portable_config
17 die('Missing or invalid config key in portable.perl');
18 }
19
20 # Create the object
2110s my $self = bless { }, $class;
2210s10s my $conf = $parent->portable_config;
# spent 0s making 1 call to Portable::portable_config
2310s10s my $root = $parent->dist_root;
# spent 0s making 1 call to Portable::dist_root
2410s10s foreach my $key ( sort keys %$conf ) {
# spent 0s making 1 call to Portable::Config::CORE:sort
25790s560s unless (
# spent 0s making 56 calls to Portable::Config::CORE:match, avg 0s/call
26 defined $conf->{$key}
27 and
28 length $conf->{$key}
29 and not
30 $key =~ /^ld|^libpth$/
31 ) {
32280s $self->{$key} = $conf->{$key};
33280s next;
34 }
35 #join path to directory of portable perl with value from config file
36510s if ($key eq 'perlpath') {
3710s10s $self->{$key} = Portable::FileSpec::catfile($root, split /\//, $conf->{$key});
# spent 0s making 1 call to Portable::FileSpec::catfile
38 }
39 else {
40500s500s $self->{$key} = Portable::FileSpec::catdir($root, split /\//, $conf->{$key});
# spent 0s making 50 calls to Portable::FileSpec::catdir, avg 0s/call
41 }
42 }
43800s790s foreach my $key ( grep { /^ld|^libpth$/ } keys %$self ) {
# spent 0s making 79 calls to Portable::Config::CORE:match, avg 0s/call
44 #special handling of linker config variables and libpth
4550s next unless defined $self->{$key};
4650s180s $self->{$key} =~ s/\$(\w+)/$self->{$1}/g;
# spent 0s making 5 calls to Portable::Config::CORE:subst, avg 0s/call # spent 0s making 13 calls to Portable::Config::CORE:substcont, avg 0s/call
47 }
48
4910s return $self;
50}
51
52
# spent 62.4ms (15.6+46.8) within Portable::Config::apply which was called: # once (15.6ms+46.8ms) by Portable::apply at line 101 of Portable.pm
sub apply {
5310s my $self = shift;
5410s my $parent = shift;
55
56 # Force all Config entries to load, so that
57 # all Config_heavy.pl code has run, and none
58 # of our values will be overwritten later.
5910s require Config;
60131.2ms220731.2ms my $preload = { %Config::Config };
# spent 15.6ms making 1103 calls to Config::FETCH, avg 14µs/call # spent 15.6ms making 1103 calls to Config::NEXTKEY, avg 14µs/call # spent 0s making 1 call to Config::AUTOLOAD
61
62 # Shift the tie STORE method out the way
6310s10s SCOPE: {
# spent 0s making 1 call to warnings::unimport
6420s10s
# spent 0s within Portable::Config::BEGIN@64 which was called: # once (0s+0s) by Portable::new at line 64
no warnings;
# spent 0s making 1 call to Portable::Config::BEGIN@64
6510s *Config::_TEMP = *Config::STORE;
66
# spent 0s within Portable::Config::__ANON__[C:/tmp64ng/perl/vendor/lib/Portable/Config.pm:68] which was called 79 times, avg 0s/call: # 79 times (0s+0s) by Portable::Config::apply at line 73, avg 0s/call
*Config::STORE = sub {
67790s $_[0]->{$_[1]} = $_[2];
6810s };
69 }
70
71 # Write the values to the Config hash
7210s10s foreach my $key ( sort keys %$self ) {
# spent 0s making 1 call to Portable::Config::CORE:sort
73790s790s $Config::Config{$key} = $self->{$key};
# spent 0s making 79 calls to Portable::Config::__ANON__[Portable/Config.pm:68], avg 0s/call
74 }
75
76 # Restore the STORE method
77 SCOPE: {
7830s20s
# spent 0s within Portable::Config::BEGIN@78 which was called: # once (0s+0s) by Portable::new at line 78
no warnings;
# spent 0s making 1 call to Portable::Config::BEGIN@78 # spent 0s making 1 call to warnings::unimport
7910s *Config::STORE = delete $Config::{_TEMP};
80 }
81
82 # Confirm we got all the paths
8310s10s my $volume = quotemeta $parent->dist_volume;
# spent 0s making 1 call to Portable::dist_volume
8410s11050s foreach my $key ( sort keys %Config::Config ) {
# spent 0s making 1 call to Config::FIRSTKEY # spent 0s making 1103 calls to Config::NEXTKEY, avg 0s/call # spent 0s making 1 call to Portable::Config::CORE:sort
8511030s11030s next unless defined $Config::Config{$key};
# spent 0s making 1103 calls to Config::FETCH, avg 0s/call
866860s20580s next if $Config::Config{$key} =~ /$volume/i;
# spent 0s making 686 calls to Config::FETCH, avg 0s/call # spent 0s making 686 calls to Portable::Config::CORE:match, avg 0s/call # spent 0s making 686 calls to Portable::Config::CORE:regcomp, avg 0s/call
876340s126815.6ms next unless $Config::Config{$key} =~ /\b[a-z]\:/i;
# spent 15.6ms making 634 calls to Config::FETCH, avg 25µs/call # spent 0s making 634 calls to Portable::Config::CORE:match, avg 0s/call
88 die "Failed to localize \$Config::Config{$key} ($Config::Config{$key})";
89 }
90
9110s return 1;
92}
93
9410s1;
 
# spent 0s within Portable::Config::CORE:match which was called 1455 times, avg 0s/call: # 686 times (0s+0s) by Portable::Config::apply at line 86, avg 0s/call # 634 times (0s+0s) by Portable::Config::apply at line 87, avg 0s/call # 79 times (0s+0s) by Portable::Config::new at line 43, avg 0s/call # 56 times (0s+0s) by Portable::Config::new at line 25, avg 0s/call
sub Portable::Config::CORE:match; # opcode
# spent 0s within Portable::Config::CORE:regcomp which was called 686 times, avg 0s/call: # 686 times (0s+0s) by Portable::Config::apply at line 86, avg 0s/call
sub Portable::Config::CORE:regcomp; # opcode
# spent 0s within Portable::Config::CORE:sort which was called 3 times, avg 0s/call: # once (0s+0s) by Portable::Config::new at line 24 # once (0s+0s) by Portable::Config::apply at line 84 # once (0s+0s) by Portable::Config::apply at line 72
sub Portable::Config::CORE:sort; # opcode
# spent 0s within Portable::Config::CORE:subst which was called 5 times, avg 0s/call: # 5 times (0s+0s) by Portable::Config::new at line 46, avg 0s/call
sub Portable::Config::CORE:subst; # opcode
# spent 0s within Portable::Config::CORE:substcont which was called 13 times, avg 0s/call: # 13 times (0s+0s) by Portable::Config::new at line 46, avg 0s/call
sub Portable::Config::CORE:substcont; # opcode