Profile of Config.pm

← Index
NYTProf Performance Profile «line view»
For scripts/bench.pl
Run on Mon Oct 22 16:48:56 2018
Reported on Mon Oct 22 16:49:10 2018

Filename | /usr/lib/x86_64-linux-gnu/perl/5.26/Config.pm
Statements | Executed 38 statements in 1.58ms

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 1.08ms | 1.84ms | Config::::BEGIN@11Config::BEGIN@11
7 | 5 | 1 | 30µs | 30µs | Config::::FETCHConfig::FETCH
1 | 1 | 1 | 26µs | 32µs | Config::::BEGIN@9Config::BEGIN@9
1 | 1 | 1 | 17µs | 17µs | Config::::importConfig::import
1 | 1 | 1 | 16µs | 38µs | Config::::BEGIN@47Config::BEGIN@47
1 | 1 | 1 | 14µs | 25µs | Config::::BEGIN@10Config::BEGIN@10
1 | 1 | 1 | 2µs | 2µs | Config::::TIEHASHConfig::TIEHASH
0 | 0 | 0 | 0s | 0s | Config::::AUTOLOADConfig::AUTOLOAD
0 | 0 | 0 | 0s | 0s | Config::::DESTROYConfig::DESTROY

Call graph for these subroutines as a Graphviz dot language file.

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 | 61µs | 2 | 39µs | # spent 32µs (26+7) within Config::BEGIN@9 which was called: # once (26µs+7µs) by DynaLoader::BEGIN@21 at line 9 use strict; # spent 32µs making 1 call to Config::BEGIN@9 # spent 6µs making 1 call to strict::import
10 | 2 | 50µs | 2 | 36µs | # spent 25µs (14+11) within Config::BEGIN@10 which was called: # once (14µs+11µs) by DynaLoader::BEGIN@21 at line 10 use warnings; # spent 25µs making 1 call to Config::BEGIN@10 # spent 11µs making 1 call to warnings::import
11 | 2 | 467µs | 2 | 1.92ms | # spent 1.84ms (1.08+763µs) within Config::BEGIN@11 which was called: # once (1.08ms+763µs) by DynaLoader::BEGIN@21 at line 11 use vars '%Config', '$VERSION'; # spent 1.84ms making 1 call to Config::BEGIN@11 # spent 78µs making 1 call to vars::import
12 |  |  |  |  |
13 | 1 | 1µs |  |  | $VERSION = "5.026001";
14 |  |  |  |  |
15 |  |  |  |  | # Skip @Config::EXPORT because it only contains %Config, which we special
16 |  |  |  |  | # case below as it's not a function. @Config::EXPORT won't change in the
17 |  |  |  |  | # lifetime of Perl 5.
18 | 1 | 8µs |  |  | my %Export_Cache = (myconfig => 1, config_sh => 1, config_vars => 1,
19 |  |  |  |  | config_re => 1, compile_date => 1, local_patches => 1,
20 |  |  |  |  | bincompat_options => 1, non_bincompat_options => 1,
21 |  |  |  |  | header_files => 1);
22 |  |  |  |  |
23 | 1 | 2µs |  |  | @Config::EXPORT = qw(%Config);
24 | 1 | 5µs |  |  | @Config::EXPORT_OK = keys %Export_Cache;
25 |  |  |  |  |
26 |  |  |  |  | # Need to stub all the functions to make code such as print Config::config_sh
27 |  |  |  |  | # keep working
28 |  |  |  |  |
29 |  |  |  |  | sub bincompat_options;
30 |  |  |  |  | sub compile_date;
31 |  |  |  |  | sub config_re;
32 |  |  |  |  | sub config_sh;
33 |  |  |  |  | sub config_vars;
34 |  |  |  |  | sub header_files;
35 |  |  |  |  | sub local_patches;
36 |  |  |  |  | sub myconfig;
37 |  |  |  |  | sub non_bincompat_options;
38 |  |  |  |  |
39 |  |  |  |  | # Define our own import method to avoid pulling in the full Exporter:
40 |  |  |  |  | # spent 17µs within Config::import which was called: # once (17µs+0s) by DynaLoader::BEGIN@21 at line 21 of DynaLoader.pm sub import {
41 | 1 | 400ns |  |  | shift;
42 | 1 | 2µs |  |  | @_ = @Config::EXPORT unless @_;
43 |  |  |  |  |
44 | 1 | 2µs |  |  | my @funcs = grep $_ ne '%Config', @_;
45 | 1 | 1µs |  |  | my $export_Config = @funcs < @_ ? 1 : 0;
46 |  |  |  |  |
47 | 2 | 791µs | 2 | 61µs | # spent 38µs (16+22) within Config::BEGIN@47 which was called: # once (16µs+22µs) by DynaLoader::BEGIN@21 at line 47 no strict 'refs'; # spent 38µs making 1 call to Config::BEGIN@47 # spent 22µs making 1 call to strict::unimport
48 | 1 | 1µs |  |  | my $callpkg = caller(0);
49 | 1 | 1µs |  |  | foreach my $func (@funcs) {
50 |  |  |  |  | die qq{"$func" is not exported by the Config module\n}
51 |  |  |  |  | unless $Export_Cache{$func};
52 |  |  |  |  | *{$callpkg.'::'.$func} = \&{$func};
53 |  |  |  |  | }
54 |  |  |  |  |
55 | 1 | 6µs |  |  | *{"$callpkg\::Config"} = \%Config if $export_Config;
56 | 1 | 5µs |  |  | return;
57 |  |  |  |  | }
58 |  |  |  |  |
59 | 1 | 67µs | 1 | 7µs | die "$0: Perl lib version (5.26.1) doesn't match executable '$^X' version ($])" # spent 7µs making 1 call to version::(bool
60 |  |  |  |  | unless $^V;
61 |  |  |  |  |
62 | 1 | 17µs | 1 | 5µs | $^V eq 5.26.1 # spent 5µs making 1 call to version::(cmp
63 |  |  |  |  | or die sprintf "%s: Perl lib version (5.26.1) doesn't match executable '$^X' version (%vd)", $0, $^V;
64 |  |  |  |  |
65 |  |  |  |  | # spent 30µs within Config::FETCH which was called 7 times, avg 4µs/call: # 3 times (22µs+0s) by main::BEGIN@27 at line 40 of DynaLoader.pm, avg 8µs/call # once (3µs+0s) by main::BEGIN@27 at line 57 of DynaLoader.pm # once (2µs+0s) by main::BEGIN@27 at line 55 of DynaLoader.pm # once (2µs+0s) by main::BEGIN@27 at line 59 of DynaLoader.pm # once (1µs+0s) by main::BEGIN@27 at line 58 of DynaLoader.pm sub FETCH {
66 | 7 | 4µs |  |  | my($self, $key) = @_;
67 |  |  |  |  |
68 |  |  |  |  | # check for cached value (which may be undef so we use exists not defined)
69 | 7 | 35µs |  |  | return exists $self->{$key} ? $self->{$key} : $self->fetch_string($key);
70 |  |  |  |  | }
71 |  |  |  |  |
72 |  |  |  |  | # spent 2µs within Config::TIEHASH which was called: # once (2µs+0s) by DynaLoader::BEGIN@21 at line 85 sub TIEHASH {
73 | 1 | 5µs |  |  | bless $_[1], $_[0];
74 |  |  |  |  | }
75 |  |  |  |  |
76 |  |  |  |  | sub DESTROY { }
77 |  |  |  |  |
78 |  |  |  |  | sub AUTOLOAD {
79 |  |  |  |  | require 'Config_heavy.pl';
80 |  |  |  |  | goto \&launcher unless $Config::AUTOLOAD =~ /launcher$/;
81 |  |  |  |  | die "&Config::AUTOLOAD failed on $Config::AUTOLOAD";
82 |  |  |  |  | }
83 |  |  |  |  |
84 |  |  |  |  | # tie returns the object, so the value returned to require will be true.
85 | 1 | 48µs | 1 | 2µs | tie %Config, 'Config', { # spent 2µs making 1 call to Config::TIEHASH
86 |  |  |  |  | archlibexp => '/usr/lib/x86_64-linux-gnu/perl/5.26',
87 |  |  |  |  | archname => 'x86_64-linux-gnu-thread-multi',
88 |  |  |  |  | cc => 'x86_64-linux-gnu-gcc',
89 |  |  |  |  | d_readlink => 'define',
90 |  |  |  |  | d_symlink => 'define',
91 |  |  |  |  | dlext => 'so',
92 |  |  |  |  | dlsrc => 'dl_dlopen.xs',
93 |  |  |  |  | dont_use_nlink => undef,
94 |  |  |  |  | exe_ext => '',
95 |  |  |  |  | inc_version_list => '5.26.0 5.26.0/x86_64-linux-gnu-thread-multi',
96 |  |  |  |  | intsize => '4',
97 |  |  |  |  | ldlibpthname => 'LD_LIBRARY_PATH',
98 |  |  |  |  | libpth => '/usr/local/lib /usr/lib/gcc/x86_64-linux-gnu/7/include-fixed /usr/include/x86_64-linux-gnu /usr/lib /lib/x86_64-linux-gnu /lib/../lib /usr/lib/x86_64-linux-gnu /usr/lib/../lib /lib',
99 |  |  |  |  | osname => 'linux',
100 |  |  |  |  | osvers => '4.9.0',
101 |  |  |  |  | path_sep => ':',
102 |  |  |  |  | privlibexp => '/usr/share/perl/5.26',
103 |  |  |  |  | scriptdir => '/usr/bin',
104 |  |  |  |  | sitearchexp => '/usr/local/lib/x86_64-linux-gnu/perl/5.26.1',
105 |  |  |  |  | sitelibexp => '/usr/local/share/perl/5.26.1',
106 |  |  |  |  | so => 'so',
107 |  |  |  |  | useithreads => 'define',
108 |  |  |  |  | usevendorprefix => 'define',
109 |  |  |  |  | version => '5.26.1',
110 |  |  |  |  | };