| File | /usr/lib/perl/5.10/Config.pm |
| Statements Executed | 30 |
| Total Time | 0.0006989 seconds |
| Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
|---|---|---|---|---|---|
| 4 | 4 | 1 | 30µs | 30µs | Config::FETCH |
| 1 | 1 | 1 | 27µs | 27µs | Config::import |
| 0 | 0 | 0 | 0s | 0s | Config::AUTOLOAD |
| 0 | 0 | 0 | 0s | 0s | Config::BEGIN |
| 0 | 0 | 0 | 0s | 0s | Config::DESTROY |
| 0 | 0 | 0 | 0s | 0s | Config::TIEHASH |
| Line | Stmts. | Exclusive Time | Avg. | 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 | package Config; | |||
| 5 | 3 | 175µs | 58µs | use strict; # spent 12µs making 1 call to strict::import |
| 6 | # use warnings; Pulls in Carp | |||
| 7 | # use vars pulls in Carp | |||
| 8 | 1 | 2µs | 2µs | @Config::EXPORT = qw(%Config); |
| 9 | 1 | 1µs | 1µs | @Config::EXPORT_OK = qw(myconfig config_sh config_vars config_re); |
| 10 | ||||
| 11 | # Need to stub all the functions to make code such as print Config::config_sh | |||
| 12 | # keep working | |||
| 13 | ||||
| 14 | sub myconfig; | |||
| 15 | sub config_sh; | |||
| 16 | sub config_vars; | |||
| 17 | sub config_re; | |||
| 18 | ||||
| 19 | 1 | 13µs | 13µs | my %Export_Cache = map {($_ => 1)} (@Config::EXPORT, @Config::EXPORT_OK); |
| 20 | ||||
| 21 | 1 | 200ns | 200ns | our %Config; |
| 22 | ||||
| 23 | # Define our own import method to avoid pulling in the full Exporter: | |||
| 24 | # spent 27µs within Config::import which was called
# once (27µs+0s) by DynaLoader::BEGIN at line 24 of /usr/lib/perl/5.10/DynaLoader.pm | |||
| 25 | 1 | 900ns | 900ns | my $pkg = shift; |
| 26 | 1 | 2µs | 2µs | @_ = @Config::EXPORT unless @_; |
| 27 | ||||
| 28 | 1 | 4µs | 4µs | my @funcs = grep $_ ne '%Config', @_; |
| 29 | 1 | 1µs | 1µs | my $export_Config = @funcs < @_ ? 1 : 0; |
| 30 | ||||
| 31 | 3 | 408µs | 136µs | no strict 'refs'; # spent 26µs making 1 call to strict::unimport |
| 32 | 1 | 1µs | 1µs | my $callpkg = caller(0); |
| 33 | 1 | 1µs | 1µs | foreach my $func (@funcs) { |
| 34 | die sprintf qq{"%s" is not exported by the %s module\n}, | |||
| 35 | $func, __PACKAGE__ unless $Export_Cache{$func}; | |||
| 36 | *{$callpkg.'::'.$func} = \&{$func}; | |||
| 37 | } | |||
| 38 | ||||
| 39 | 1 | 3µs | 3µs | *{"$callpkg\::Config"} = \%Config if $export_Config; |
| 40 | 1 | 7µs | 7µs | return; |
| 41 | } | |||
| 42 | ||||
| 43 | 1 | 9µs | 9µs | die "Perl lib version (5.10.0) doesn't match executable version ($])" |
| 44 | unless $^V; | |||
| 45 | ||||
| 46 | 1 | 8µs | 8µs | $^V eq 5.10.0 |
| 47 | or die "Perl lib version (5.10.0) doesn't match executable version (" . | |||
| 48 | sprintf("v%vd",$^V) . ")"; | |||
| 49 | ||||
| 50 | # spent 30µs within Config::FETCH which was called 4 times, avg 7µs/call:
# once (9µs+0s) at line 64 of /usr/lib/perl/5.10/DynaLoader.pm
# once (9µs+0s) at line 66 of /usr/lib/perl/5.10/DynaLoader.pm
# once (6µs+0s) at line 67 of /usr/lib/perl/5.10/DynaLoader.pm
# once (5µs+0s) at line 68 of /usr/lib/perl/5.10/DynaLoader.pm | |||
| 51 | 4 | 5µs | 1µs | my($self, $key) = @_; |
| 52 | ||||
| 53 | # check for cached value (which may be undef so we use exists not defined) | |||
| 54 | 4 | 8µs | 2µs | return $self->{$key} if exists $self->{$key}; |
| 55 | ||||
| 56 | return $self->fetch_string($key); | |||
| 57 | } | |||
| 58 | sub TIEHASH { | |||
| 59 | 1 | 5µs | 5µs | bless $_[1], $_[0]; |
| 60 | } | |||
| 61 | ||||
| 62 | sub DESTROY { } | |||
| 63 | ||||
| 64 | sub AUTOLOAD { | |||
| 65 | require 'Config_heavy.pl'; | |||
| 66 | goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/; | |||
| 67 | die "&Config::AUTOLOAD failed on $Config::AUTOLOAD"; | |||
| 68 | } | |||
| 69 | ||||
| 70 | # tie returns the object, so the value returned to require will be true. | |||
| 71 | 1 | 44µs | 44µs | tie %Config, 'Config', { |
| 72 | archlibexp => '/usr/lib/perl/5.10', | |||
| 73 | archname => 'x86_64-linux-gnu-thread-multi', | |||
| 74 | cc => 'cc', | |||
| 75 | d_readlink => 'define', | |||
| 76 | d_symlink => 'define', | |||
| 77 | dlsrc => 'dl_dlopen.xs', | |||
| 78 | dont_use_nlink => undef, | |||
| 79 | exe_ext => '', | |||
| 80 | inc_version_list => '', | |||
| 81 | intsize => '4', | |||
| 82 | ldlibpthname => 'LD_LIBRARY_PATH', | |||
| 83 | libpth => '/usr/local/lib /lib /usr/lib /lib64 /usr/lib64', | |||
| 84 | osname => 'linux', | |||
| 85 | osvers => '2.6.30.5-dsa-amd64', | |||
| 86 | path_sep => ':', | |||
| 87 | privlibexp => '/usr/share/perl/5.10', | |||
| 88 | scriptdir => '/usr/bin', | |||
| 89 | sitearchexp => '/usr/local/lib/perl/5.10.0', | |||
| 90 | sitelibexp => '/usr/local/share/perl/5.10.0', | |||
| 91 | useithreads => 'define', | |||
| 92 | usevendorprefix => 'define', | |||
| 93 | version => '5.10.0', | |||
| 94 | }; |