← Index
NYTProf Performance Profile   « block view • line view • sub view »
For C:/lo/libo-master/solenv/bin/make_installer.pl
  Run on Mon Sep 24 00:52:54 2012
Reported on Mon Sep 24 07:34:48 2012

Filename/usr/lib/perl5/5.14/Exporter/Heavy.pm
StatementsExecuted 1461 statements in 12.9ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
10118.28ms10.0msExporter::Heavy::::heavy_exportExporter::Heavy::heavy_export
865511.14ms1.14msExporter::Heavy::::CORE:substExporter::Heavy::CORE:subst (opcode)
111194µs200µsExporter::Heavy::::BEGIN@3Exporter::Heavy::BEGIN@3
221107µs107µsExporter::Heavy::::_push_tagsExporter::Heavy::_push_tags
11140µs84µsExporter::Heavy::::BEGIN@197Exporter::Heavy::BEGIN@197
322137µs37µsExporter::Heavy::::CORE:matchExporter::Heavy::CORE:match (opcode)
11130µs543µsExporter::Heavy::::__ANON__[:52]Exporter::Heavy::__ANON__[:52]
11126µs28µsExporter::Heavy::::_rebuild_cacheExporter::Heavy::_rebuild_cache
11123µs174µsExporter::Heavy::::heavy_export_to_levelExporter::Heavy::heavy_export_to_level
11114µs36µsExporter::Heavy::::BEGIN@4Exporter::Heavy::BEGIN@4
11111µs47µsExporter::Heavy::::heavy_export_tagsExporter::Heavy::heavy_export_tags
11110µs82µsExporter::Heavy::::heavy_export_ok_tagsExporter::Heavy::heavy_export_ok_tags
0000s0sExporter::Heavy::::__ANON__[:58]Exporter::Heavy::__ANON__[:58]
0000s0sExporter::Heavy::::heavy_require_versionExporter::Heavy::heavy_require_version
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Exporter::Heavy;
2
3262µs2206µs
# spent 200µs (194+6) within Exporter::Heavy::BEGIN@3 which was called: # once (194µs+6µs) by Exporter::as_heavy at line 3
use strict;
# spent 200µs making 1 call to Exporter::Heavy::BEGIN@3 # spent 6µs making 1 call to strict::import
422.27ms259µs
# spent 36µs (14+22) within Exporter::Heavy::BEGIN@4 which was called: # once (14µs+22µs) by Exporter::as_heavy at line 4
no strict 'refs';
# spent 36µs making 1 call to Exporter::Heavy::BEGIN@4 # spent 22µs making 1 call to strict::unimport
5
6# On one line so MakeMaker will see it.
723µsrequire Exporter; our $VERSION = $Exporter::VERSION;
8
9=head1 NAME
10
11Exporter::Heavy - Exporter guts
12
13=head1 SYNOPSIS
14
15(internal use only)
16
17=head1 DESCRIPTION
18
19No user-serviceable parts inside.
20
21=cut
22
23#
24# We go to a lot of trouble not to 'require Carp' at file scope,
25# because Carp requires Exporter, and something has to give.
26#
27
28
# spent 28µs (26+2) within Exporter::Heavy::_rebuild_cache which was called: # once (26µs+2µs) by Exporter::Heavy::heavy_export at line 67
sub _rebuild_cache {
2912µs my ($pkg, $exports, $cache) = @_;
30111µs12µs s/^&// foreach @$exports;
# spent 2µs making 1 call to Exporter::Heavy::CORE:subst
3114µs @{$cache}{@$exports} = (1) x @$exports;
3216µs my $ok = \@{"${pkg}::EXPORT_OK"};
3317µs if (@$ok) {
34 s/^&// foreach @$ok;
35 @{$cache}{@$ok} = (1) x @$ok;
36 }
37}
38
39
# spent 10.0ms (8.28+1.73) within Exporter::Heavy::heavy_export which was called 10 times, avg 1.00ms/call: # 10 times (8.28ms+1.73ms) by Exporter::Heavy::heavy_export_to_level or Exporter::import at line 25 of Exporter.pm, avg 1.00ms/call
sub heavy_export {
40
41 # First make import warnings look like they're coming from the "use".
42
# spent 543µs (30+513) within Exporter::Heavy::__ANON__[/usr/lib/perl5/5.14/Exporter/Heavy.pm:52] which was called: # once (30µs+513µs) by Exporter::Heavy::heavy_export at line 194
local $SIG{__WARN__} = sub {
4312µs my $text = shift;
44129µs111µs if ($text =~ s/ at \S*Exporter\S*.pm line \d+.*\n//) {
# spent 11µs making 1 call to Exporter::Heavy::CORE:subst
4512µs require Carp;
4611µs local $Carp::CarpLevel = 1; # ignore package calling us too.
4716µs1502µs Carp::carp($text);
# spent 502µs making 1 call to Carp::carp
48 }
49 else {
50 warn $text;
51 }
5210141µs };
53 local $SIG{__DIE__} = sub {
54 require Carp;
55 local $Carp::CarpLevel = 1; # ignore package calling us too.
56 Carp::croak("$_[0]Illegal null symbol in \@${1}::EXPORT")
57 if $_[0] =~ /^Unable to create sub named "(.*?)::"/;
581093µs };
59
601036µs my($pkg, $callpkg, @imports) = @_;
61108µs my($type, $sym, $cache_is_current, $oops);
621041µs my($exports, $export_cache) = (\@{"${pkg}::EXPORT"},
63 $Exporter::Cache{$pkg} ||= {});
64
651014µs if (@imports) {
66929µs if (!%$export_cache) {
6714µs128µs _rebuild_cache ($pkg, $exports, $export_cache);
# spent 28µs making 1 call to Exporter::Heavy::_rebuild_cache
6812µs $cache_is_current = 1;
69 }
70
719133µs2427µs if (grep m{^[/!:]}, @imports) {
# spent 27µs making 24 calls to Exporter::Heavy::CORE:match, avg 1µs/call
72823µs my $tagsref = \%{"${pkg}::EXPORT_TAGS"};
7383µs my $tagdata;
7487µs my %imports;
7586µs my($remove, $spec, @names, @allexports);
76 # negated first item implies starting with default set:
77836µs810µs unshift @imports, ':DEFAULT' if $imports[0] =~ m/^!/;
# spent 10µs making 8 calls to Exporter::Heavy::CORE:match, avg 1µs/call
78815µs foreach $spec (@imports){
792396µs2315µs $remove = $spec =~ s/^!//;
# spent 15µs making 23 calls to Exporter::Heavy::CORE:subst, avg 665ns/call
80
8123120µs2341µs if ($spec =~ s/^://){
# spent 41µs making 23 calls to Exporter::Heavy::CORE:subst, avg 2µs/call
8223267µs if ($spec eq 'DEFAULT'){
83 @names = @$exports;
84 }
85 elsif ($tagdata = $tagsref->{$spec}) {
86 @names = @$tagdata;
87 }
88 else {
89 warn qq["$spec" is not defined in %${pkg}::EXPORT_TAGS];
90 ++$oops;
91 next;
92 }
93 }
94 elsif ($spec =~ m:^/(.*)/$:){
95 my $patn = $1;
96 @allexports = keys %$export_cache unless @allexports; # only do keys once
97 @names = grep(/$patn/, @allexports); # not anchored by default
98 }
99 else {
100 @names = ($spec); # is a normal symbol name
101 }
102
103239µs warn "Import ".($remove ? "del":"add").": @names "
104 if $Exporter::Verbose;
105
1062353µs if ($remove) {
107 foreach $sym (@names) { delete $imports{$sym} }
108 }
109 else {
11023196µs @imports{@names} = (1) x @names;
111 }
112 }
1138171µs @imports = keys %imports;
114 }
115
11694µs my @carp;
117916µs foreach $sym (@imports) {
118264223µs if (!$export_cache->{$sym}) {
119 if ($sym =~ m/^\d/) {
120 $pkg->VERSION($sym); # inherit from UNIVERSAL
121 # If the version number was the only thing specified
122 # then we should act as if nothing was specified:
123 if (@imports == 1) {
124 @imports = @$exports;
125 last;
126 }
127 # We need a way to emulate 'use Foo ()' but still
128 # allow an easy version check: "use Foo 1.23, ''";
129 if (@imports == 2 and !$imports[1]) {
130 @imports = ();
131 last;
132 }
133 } elsif ($sym !~ s/^&// || !$export_cache->{$sym}) {
134 # Last chance - see if they've updated EXPORT_OK since we
135 # cached it.
136
137 unless ($cache_is_current) {
138 %$export_cache = ();
139 _rebuild_cache ($pkg, $exports, $export_cache);
140 $cache_is_current = 1;
141 }
142
143 if (!$export_cache->{$sym}) {
144 # accumulate the non-exports
145 push @carp,
146 qq["$sym" is not exported by the $pkg module\n];
147 $oops++;
148 }
149 }
150 }
151 }
15296µs if ($oops) {
153 require Carp;
154 Carp::croak("@{carp}Can't continue after import errors");
155 }
156 }
157 else {
1581110µs @imports = @$exports;
159 }
160
1611059µs my($fail, $fail_cache) = (\@{"${pkg}::EXPORT_FAIL"},
162 $Exporter::FailCache{$pkg} ||= {});
163
164108µs if (@$fail) {
165 if (!%$fail_cache) {
166 # Build cache of symbols. Optimise the lookup by adding
167 # barewords twice... both with and without a leading &.
168 # (Technique could be applied to $export_cache at cost of memory)
169 my @expanded = map { /^\w/ ? ($_, '&'.$_) : $_ } @$fail;
170 warn "${pkg}::EXPORT_FAIL cached: @expanded" if $Exporter::Verbose;
171 @{$fail_cache}{@expanded} = (1) x @expanded;
172 }
173 my @failed;
174 foreach $sym (@imports) { push(@failed, $sym) if $fail_cache->{$sym} }
175 if (@failed) {
176 @failed = $pkg->export_fail(@failed);
177 foreach $sym (@failed) {
178 require Carp;
179 Carp::carp(qq["$sym" is not implemented by the $pkg module ],
180 "on this architecture");
181 }
182 if (@failed) {
183 require Carp;
184 Carp::croak("Can't continue after import errors");
185 }
186 }
187 }
188
189107µs warn "Importing into $callpkg from $pkg: ",
190 join(", ",sort @imports) if $Exporter::Verbose;
191
19210804µs foreach $sym (@imports) {
193 # shortcut for the common case of no type character
1948176.71ms8181.61ms (*{"${callpkg}::$sym"} = \&{"${pkg}::$sym"}, next)
# spent 1.07ms making 817 calls to Exporter::Heavy::CORE:subst, avg 1µs/call # spent 543µs making 1 call to Exporter::Heavy::__ANON__[Exporter/Heavy.pm:52]
195 unless $sym =~ s/^(\W)//;
19615µs $type = $1;
1972906µs2128µs
# spent 84µs (40+44) within Exporter::Heavy::BEGIN@197 which was called: # once (40µs+44µs) by Exporter::as_heavy at line 197
no warnings 'once';
# spent 84µs making 1 call to Exporter::Heavy::BEGIN@197 # spent 44µs making 1 call to warnings::unimport
198 *{"${callpkg}::$sym"} =
199 $type eq '&' ? \&{"${pkg}::$sym"} :
200 $type eq '$' ? \${"${pkg}::$sym"} :
201 $type eq '@' ? \@{"${pkg}::$sym"} :
202 $type eq '%' ? \%{"${pkg}::$sym"} :
203 $type eq '*' ? *{"${pkg}::$sym"} :
204111µs do { require Carp; Carp::croak("Can't export symbol: $type$sym") };
205 }
206}
207
208sub heavy_export_to_level
209
# spent 174µs (23+151) within Exporter::Heavy::heavy_export_to_level which was called: # once (23µs+151µs) by Class::Struct::import at line 82 of Exporter.pm
{
21011µs my $pkg = shift;
21111µs my $level = shift;
21211µs (undef) = shift; # XXX redundant arg
21312µs my $callpkg = caller($level);
214112µs125µs $pkg->export($callpkg, @_);
# spent 25µs making 1 call to Exporter::export
215}
216
217# Utility functions
218
219
# spent 107µs within Exporter::Heavy::_push_tags which was called 2 times, avg 54µs/call: # once (72µs+0s) by Exporter::Heavy::heavy_export_ok_tags at line 245 # once (35µs+0s) by Exporter::Heavy::heavy_export_tags at line 241
sub _push_tags {
22026µs my($pkg, $var, $syms) = @_;
22122µs my @nontag = ();
222210µs my $export_tags = \%{"${pkg}::EXPORT_TAGS"};
223 push(@{"${pkg}::$var"},
224284µs map { $export_tags->{$_} ? @{$export_tags->{$_}}
225 : scalar(push(@nontag,$_),$_) }
226 (@$syms) ? @$syms : keys %$export_tags);
227214µs if (@nontag and $^W) {
228 # This may change to a die one day
229 require Carp;
230 Carp::carp(join(", ", @nontag)." are not tags of $pkg");
231 }
232}
233
234sub heavy_require_version {
235 my($self, $wanted) = @_;
236 my $pkg = ref $self || $self;
237 return ${pkg}->VERSION($wanted);
238}
239
240
# spent 47µs (11+35) within Exporter::Heavy::heavy_export_tags which was called: # once (11µs+35µs) by Archive::Zip::BEGIN@14 at line 86 of Exporter.pm
sub heavy_export_tags {
241111µs135µs _push_tags((caller)[0], "EXPORT", \@_);
# spent 35µs making 1 call to Exporter::Heavy::_push_tags
242}
243
244
# spent 82µs (10+72) within Exporter::Heavy::heavy_export_ok_tags which was called: # once (10µs+72µs) by Archive::Zip::BEGIN@37 at line 90 of Exporter.pm
sub heavy_export_ok_tags {
245111µs172µs _push_tags((caller)[0], "EXPORT_OK", \@_);
# spent 72µs making 1 call to Exporter::Heavy::_push_tags
246}
247
248114µs1;
 
# spent 37µs within Exporter::Heavy::CORE:match which was called 32 times, avg 1µs/call: # 24 times (27µs+0s) by Exporter::Heavy::heavy_export at line 71, avg 1µs/call # 8 times (10µs+0s) by Exporter::Heavy::heavy_export at line 77, avg 1µs/call
sub Exporter::Heavy::CORE:match; # opcode
# spent 1.14ms within Exporter::Heavy::CORE:subst which was called 865 times, avg 1µs/call: # 817 times (1.07ms+0s) by Exporter::Heavy::heavy_export at line 194, avg 1µs/call # 23 times (41µs+0s) by Exporter::Heavy::heavy_export at line 81, avg 2µs/call # 23 times (15µs+0s) by Exporter::Heavy::heavy_export at line 79, avg 665ns/call # once (11µs+0s) by Exporter::Heavy::__ANON__[/usr/lib/perl5/5.14/Exporter/Heavy.pm:52] at line 44 # once (2µs+0s) by Exporter::Heavy::_rebuild_cache at line 30
sub Exporter::Heavy::CORE:subst; # opcode