| Filename | /home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/x86_64-linux/Config.pm |
| Statements | Executed 51 statements in 699µs |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 1 | 1 | 1 | 1.70ms | 1.79ms | Config::AUTOLOAD |
| 9 | 7 | 3 | 80µs | 2.05ms | Config::FETCH |
| 2 | 2 | 2 | 46µs | 46µs | Config::import |
| 1 | 1 | 1 | 25µs | 30µs | Config::BEGIN@9 |
| 1 | 1 | 1 | 10µs | 33µs | Config::BEGIN@38 |
| 1 | 1 | 1 | 6µs | 6µs | Config::TIEHASH |
| 0 | 0 | 0 | 0s | 0s | Config::DESTROY |
| Line | State ments |
Time on line |
Calls | Time in subs |
Code |
|---|---|---|---|---|---|
| 1 | # This file was created by configpm when Perl was built. Any changes | ||||
| 2 | # made to this file will be lost the next time perl is built. | ||||
| 3 | |||||
| 4 | # for a description of the variables, please have a look at the | ||||
| 5 | # Glossary file, as written in the Porting folder, or use the url: | ||||
| 6 | # http://perl5.git.perl.org/perl.git/blob/HEAD:/Porting/Glossary | ||||
| 7 | |||||
| 8 | package Config; | ||||
| 9 | 2 | 120µs | 2 | 36µs | # spent 30µs (25+5) within Config::BEGIN@9 which was called:
# once (25µs+5µs) by Tie::RefHash::BEGIN@99 at line 9 # spent 30µs making 1 call to Config::BEGIN@9
# spent 5µs making 1 call to strict::import |
| 10 | # use warnings; Pulls in Carp | ||||
| 11 | # use vars pulls in Carp | ||||
| 12 | 1 | 2µs | @Config::EXPORT = qw(%Config); | ||
| 13 | 1 | 2µs | @Config::EXPORT_OK = qw(myconfig config_sh config_vars config_re); | ||
| 14 | |||||
| 15 | # Need to stub all the functions to make code such as print Config::config_sh | ||||
| 16 | # keep working | ||||
| 17 | |||||
| 18 | sub myconfig; | ||||
| 19 | sub config_sh; | ||||
| 20 | sub config_vars; | ||||
| 21 | sub config_re; | ||||
| 22 | |||||
| 23 | # Skip @Config::EXPORT because it only contains %Config, which we special | ||||
| 24 | # case below as it's not a function. @Config::EXPORT won't change in the | ||||
| 25 | # lifetime of Perl 5. | ||||
| 26 | 1 | 6µs | my %Export_Cache = map {($_ => 1)} @Config::EXPORT_OK; | ||
| 27 | |||||
| 28 | 1 | 1µs | our %Config; | ||
| 29 | |||||
| 30 | # Define our own import method to avoid pulling in the full Exporter: | ||||
| 31 | # spent 46µs within Config::import which was called 2 times, avg 23µs/call:
# once (24µs+0s) by Fatal::BEGIN@8 at line 8 of Fatal.pm
# once (21µs+0s) by DynaLoader::BEGIN@25 at line 25 of DynaLoader.pm | ||||
| 32 | 2 | 3µs | shift; | ||
| 33 | 2 | 7µs | @_ = @Config::EXPORT unless @_; | ||
| 34 | |||||
| 35 | 2 | 6µs | my @funcs = grep $_ ne '%Config', @_; | ||
| 36 | 2 | 4µs | my $export_Config = @funcs < @_ ? 1 : 0; | ||
| 37 | |||||
| 38 | 2 | 279µs | 2 | 55µs | # spent 33µs (10+22) within Config::BEGIN@38 which was called:
# once (10µs+22µs) by Tie::RefHash::BEGIN@99 at line 38 # spent 33µs making 1 call to Config::BEGIN@38
# spent 22µs making 1 call to strict::unimport |
| 39 | 2 | 4µs | my $callpkg = caller(0); | ||
| 40 | 2 | 6µs | foreach my $func (@funcs) { | ||
| 41 | die qq{"$func" is not exported by the Config module\n} | ||||
| 42 | unless $Export_Cache{$func}; | ||||
| 43 | *{$callpkg.'::'.$func} = \&{$func}; | ||||
| 44 | } | ||||
| 45 | |||||
| 46 | 2 | 9µs | *{"$callpkg\::Config"} = \%Config if $export_Config; | ||
| 47 | 2 | 12µs | return; | ||
| 48 | } | ||||
| 49 | |||||
| 50 | 1 | 14µs | 1 | 6µs | die "Perl lib version (5.13.5) doesn't match executable '$0' version ($])" # spent 6µs making 1 call to version::(bool |
| 51 | unless $^V; | ||||
| 52 | |||||
| 53 | 1 | 13µs | 1 | 6µs | $^V eq 5.13.5 # spent 6µs making 1 call to version::(cmp |
| 54 | or die "Perl lib version (5.13.5) doesn't match executable '$0' version (" . | ||||
| 55 | sprintf("v%vd",$^V) . ")"; | ||||
| 56 | |||||
| 57 | |||||
| 58 | # spent 2.05ms (80µs+1.97) within Config::FETCH which was called 9 times, avg 227µs/call:
# 3 times (27µs+118µs) by base::import at line 43 of DynaLoader.pm, avg 48µs/call
# once (24µs+1.85ms) by Tie::RefHash::BEGIN@96 at line 100 of Tie/RefHash.pm
# once (11µs+0s) by autodie::BEGIN@6 at line 58 of Fatal.pm
# once (5µs+0s) by base::import at line 63 of DynaLoader.pm
# once (4µs+0s) by base::import at line 68 of DynaLoader.pm
# once (4µs+0s) by base::import at line 67 of DynaLoader.pm
# once (4µs+0s) by base::import at line 66 of DynaLoader.pm | ||||
| 59 | 9 | 15µs | my($self, $key) = @_; | ||
| 60 | |||||
| 61 | # check for cached value (which may be undef so we use exists not defined) | ||||
| 62 | 9 | 39µs | return $self->{$key} if exists $self->{$key}; | ||
| 63 | |||||
| 64 | 3 | 23µs | 3 | 1.91ms | return $self->fetch_string($key); # spent 1.79ms making 1 call to Config::AUTOLOAD
# spent 118µs making 2 calls to Config::fetch_string, avg 59µs/call |
| 65 | } | ||||
| 66 | # spent 6µs within Config::TIEHASH which was called:
# once (6µs+0s) by Tie::RefHash::BEGIN@99 at line 79 | ||||
| 67 | 1 | 11µs | bless $_[1], $_[0]; | ||
| 68 | } | ||||
| 69 | |||||
| 70 | sub DESTROY { } | ||||
| 71 | |||||
| 72 | # spent 1.79ms (1.70+90µs) within Config::AUTOLOAD which was called:
# once (1.70ms+90µs) by Config::FETCH at line 64 | ||||
| 73 | 1 | 80µs | require 'Config_heavy.pl'; | ||
| 74 | 1 | 19µs | 2 | 10µs | goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/; # spent 8µs making 1 call to Config::launcher
# spent 2µs making 1 call to Config::CORE:match |
| 75 | die "&Config::AUTOLOAD failed on $Config::AUTOLOAD"; | ||||
| 76 | } | ||||
| 77 | |||||
| 78 | # tie returns the object, so the value returned to require will be true. | ||||
| 79 | 1 | 26µs | 1 | 6µs | tie %Config, 'Config', { # spent 6µs making 1 call to Config::TIEHASH |
| 80 | archlibexp => '/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/x86_64-linux', | ||||
| 81 | archname => 'x86_64-linux', | ||||
| 82 | cc => 'cc', | ||||
| 83 | d_readlink => 'define', | ||||
| 84 | d_symlink => 'define', | ||||
| 85 | dlsrc => 'dl_dlopen.xs', | ||||
| 86 | dont_use_nlink => undef, | ||||
| 87 | exe_ext => '', | ||||
| 88 | inc_version_list => '', | ||||
| 89 | intsize => '4', | ||||
| 90 | ldlibpthname => 'LD_LIBRARY_PATH', | ||||
| 91 | libpth => '/usr/local/lib /lib /usr/lib /lib64 /usr/lib64', | ||||
| 92 | osname => 'linux', | ||||
| 93 | osvers => '2.6.32-5-amd64', | ||||
| 94 | path_sep => ':', | ||||
| 95 | privlibexp => '/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5', | ||||
| 96 | scriptdir => '/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/bin', | ||||
| 97 | sitearchexp => '/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5/x86_64-linux', | ||||
| 98 | sitelibexp => '/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/site_perl/5.13.5', | ||||
| 99 | useithreads => undef, | ||||
| 100 | usevendorprefix => undef, | ||||
| 101 | version => '5.13.5', | ||||
| 102 | }; |