| Filename | C:/tmp64ng/perl/vendor/lib/Portable/Config.pm |
| Statements | Executed 2943 statements in 31.2ms |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 15.6ms | 62.4ms | Portable::Config::apply |
| 1 | 1 | 1 | 0s | 0s | Portable::Config::BEGIN@3 |
| 1 | 1 | 1 | 0s | 0s | Portable::Config::BEGIN@4 |
| 1 | 1 | 1 | 0s | 0s | Portable::Config::BEGIN@5 |
| 1 | 1 | 1 | 0s | 0s | Portable::Config::BEGIN@6 |
| 1 | 1 | 1 | 0s | 0s | Portable::Config::BEGIN@64 |
| 1 | 1 | 1 | 0s | 0s | Portable::Config::BEGIN@78 |
| 1455 | 4 | 1 | 0s | 0s | Portable::Config::CORE:match (opcode) |
| 686 | 1 | 1 | 0s | 0s | Portable::Config::CORE:regcomp (opcode) |
| 3 | 3 | 1 | 0s | 0s | Portable::Config::CORE:sort (opcode) |
| 5 | 1 | 1 | 0s | 0s | Portable::Config::CORE:subst (opcode) |
| 13 | 1 | 1 | 0s | 0s | Portable::Config::CORE:substcont (opcode) |
| 79 | 1 | 1 | 0s | 0s | Portable::Config::__ANON__[:68] |
| 1 | 1 | 1 | 0s | 0s | Portable::Config::new |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | package Portable::Config; | ||||
| 2 | |||||
| 3 | 2 | 0s | 1 | 0s | # spent 0s within Portable::Config::BEGIN@3 which was called:
# once (0s+0s) by Portable::new at line 3 # spent 0s making 1 call to Portable::Config::BEGIN@3 |
| 4 | 2 | 0s | 2 | 0s | # spent 0s within Portable::Config::BEGIN@4 which was called:
# once (0s+0s) by Portable::new at line 4 # spent 0s making 1 call to Portable::Config::BEGIN@4
# spent 0s making 1 call to strict::import |
| 5 | 2 | 0s | 2 | 0s | # spent 0s within Portable::Config::BEGIN@5 which was called:
# once (0s+0s) by Portable::new at line 5 # spent 0s making 1 call to Portable::Config::BEGIN@5
# spent 0s making 1 call to warnings::import |
| 6 | 2 | 0s | 1 | 0s | # spent 0s within Portable::Config::BEGIN@6 which was called:
# once (0s+0s) by Portable::new at line 6 # spent 0s making 1 call to Portable::Config::BEGIN@6 |
| 7 | |||||
| 8 | 1 | 0s | our $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 | ||||
| 14 | 1 | 0s | my $class = shift; | ||
| 15 | 1 | 0s | my $parent = shift; | ||
| 16 | 1 | 0s | 2 | 0s | 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 | ||||
| 21 | 1 | 0s | my $self = bless { }, $class; | ||
| 22 | 1 | 0s | 1 | 0s | my $conf = $parent->portable_config; # spent 0s making 1 call to Portable::portable_config |
| 23 | 1 | 0s | 1 | 0s | my $root = $parent->dist_root; # spent 0s making 1 call to Portable::dist_root |
| 24 | 1 | 0s | 1 | 0s | foreach my $key ( sort keys %$conf ) { # spent 0s making 1 call to Portable::Config::CORE:sort |
| 25 | 79 | 0s | 56 | 0s | 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 | ) { | ||||
| 32 | 28 | 0s | $self->{$key} = $conf->{$key}; | ||
| 33 | 28 | 0s | next; | ||
| 34 | } | ||||
| 35 | #join path to directory of portable perl with value from config file | ||||
| 36 | 51 | 0s | if ($key eq 'perlpath') { | ||
| 37 | 1 | 0s | 1 | 0s | $self->{$key} = Portable::FileSpec::catfile($root, split /\//, $conf->{$key}); # spent 0s making 1 call to Portable::FileSpec::catfile |
| 38 | } | ||||
| 39 | else { | ||||
| 40 | 50 | 0s | 50 | 0s | $self->{$key} = Portable::FileSpec::catdir($root, split /\//, $conf->{$key}); # spent 0s making 50 calls to Portable::FileSpec::catdir, avg 0s/call |
| 41 | } | ||||
| 42 | } | ||||
| 43 | 80 | 0s | 79 | 0s | 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 | ||||
| 45 | 5 | 0s | next unless defined $self->{$key}; | ||
| 46 | 5 | 0s | 18 | 0s | $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 | |||||
| 49 | 1 | 0s | 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 | ||||
| 53 | 1 | 0s | my $self = shift; | ||
| 54 | 1 | 0s | 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. | ||||
| 59 | 1 | 0s | require Config; | ||
| 60 | 1 | 31.2ms | 2207 | 31.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 | ||||
| 63 | 1 | 0s | 1 | 0s | SCOPE: { # spent 0s making 1 call to warnings::unimport |
| 64 | 2 | 0s | 1 | 0s | # spent 0s within Portable::Config::BEGIN@64 which was called:
# once (0s+0s) by Portable::new at line 64 # spent 0s making 1 call to Portable::Config::BEGIN@64 |
| 65 | 1 | 0s | *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 | ||||
| 67 | 79 | 0s | $_[0]->{$_[1]} = $_[2]; | ||
| 68 | 1 | 0s | }; | ||
| 69 | } | ||||
| 70 | |||||
| 71 | # Write the values to the Config hash | ||||
| 72 | 1 | 0s | 1 | 0s | foreach my $key ( sort keys %$self ) { # spent 0s making 1 call to Portable::Config::CORE:sort |
| 73 | 79 | 0s | 79 | 0s | $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: { | ||||
| 78 | 3 | 0s | 2 | 0s | # spent 0s within Portable::Config::BEGIN@78 which was called:
# once (0s+0s) by Portable::new at line 78 # spent 0s making 1 call to Portable::Config::BEGIN@78
# spent 0s making 1 call to warnings::unimport |
| 79 | 1 | 0s | *Config::STORE = delete $Config::{_TEMP}; | ||
| 80 | } | ||||
| 81 | |||||
| 82 | # Confirm we got all the paths | ||||
| 83 | 1 | 0s | 1 | 0s | my $volume = quotemeta $parent->dist_volume; # spent 0s making 1 call to Portable::dist_volume |
| 84 | 1 | 0s | 1105 | 0s | 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 |
| 85 | 1103 | 0s | 1103 | 0s | next unless defined $Config::Config{$key}; # spent 0s making 1103 calls to Config::FETCH, avg 0s/call |
| 86 | 686 | 0s | 2058 | 0s | 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 |
| 87 | 634 | 0s | 1268 | 15.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 | |||||
| 91 | 1 | 0s | return 1; | ||
| 92 | } | ||||
| 93 | |||||
| 94 | 1 | 0s | 1; | ||
# 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 | |||||
# 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: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 | |||||
# 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 |