← Index
Performance Profile   « block view • line view • sub view »
For ./awstats.pl
  Run on Wed Feb 11 19:11:27 2009
Reported on Thu Feb 12 02:07:44 2009

File/usr/share/perl/5.8/Exporter.pm
Statements Executed94
Total Time0.0028 seconds

Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
5540.002810.00281Exporter::import
00000Exporter::__ANON__[:63]
00000Exporter::as_heavy
00000Exporter::export
00000Exporter::export_fail
00000Exporter::export_ok_tags
00000Exporter::export_tags
00000Exporter::export_to_level
00000Exporter::require_version

LineStmts.Exclusive
Time
Avg.Code
1package Exporter;
2
312.0e-62.0e-6require 5.006;
4
5# Be lean.
6#use strict;
7#no strict 'refs';
8
912.0e-62.0e-6our $Debug = 0;
1011.0e-61.0e-6our $ExportLevel = 0;
1112.0e-62.0e-6our $Verbose ||= 0;
1211.0e-61.0e-6our $VERSION = '5.58';
1311.0e-61.0e-6our (%Cache);
1413.0e-63.0e-6$Carp::Internal{Exporter} = 1;
15
16sub as_heavy {
17 require Exporter::Heavy;
18 # Unfortunately, this does not work if the caller is aliased as *name = \&foo
19 # Thus the need to create a lot of identical subroutines
20 my $c = (caller(1))[3];
21 $c =~ s/.*:://;
22 \&{"Exporter::Heavy::heavy_$c"};
23}
24
25sub export {
26 goto &{as_heavy()};
27}
28
29
# spent 2.81ms within Exporter::import which was called 5 times, avg 562µs/call: # once (2.46ms+0) at line 17 of awstats.pl # once (103µs+0) at line 4 of /usr/share/perl/5.8/Time/Local.pm # once (96µs+0) at line 6 of /usr/lib/perl/5.8/Socket.pm # once (78µs+0) at line 16 of awstats.pl # once (78µs+0) at line 3 of /usr/local/lib/perl/5.8.8/Geo/IP/Record.pm
sub import {
30750.002503.3e-5 my $pkg = shift;
31 my $callpkg = caller($ExportLevel);
32
33 if ($pkg eq "Exporter" and @_ and $_[0] eq "import") {
34 *{$callpkg."::import"} = \&import;
35 return;
36 }
37
38 # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-(
39 my($exports, $fail) = (\@{"$pkg\::EXPORT"}, \@{"$pkg\::EXPORT_FAIL"});
40 return export $pkg, $callpkg, @_
41 if $Verbose or $Debug or @$fail > 1;
42 my $export_cache = ($Cache{$pkg} ||= {});
43 my $args = @_ or @_ = @$exports;
44
45 local $_;
46 if ($args and not %$export_cache) {
47 s/^&//, $export_cache->{$_} = 1
48 foreach (@$exports, @{"$pkg\::EXPORT_OK"});
49 }
50 my $heavy;
51 # Try very hard not to use {} and hence have to enter scope on the foreach
52 # We bomb out of the loop with last as soon as heavy is set.
53104.2e-54.2e-6 if ($args or $fail) {
54 ($heavy = (/\W/ or $args and not exists $export_cache->{$_}
55 or @$fail and $_ eq $fail->[0])) and last
56 foreach (@_);
57 } else {
58 ($heavy = /\W/) and last
59 foreach (@_);
60 }
6110.000240.00024 return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy;
62 local $SIG{__WARN__} =
63 sub {require Carp; &Carp::carp};
64 # shortcut for the common case of no type character
65 *{"$callpkg\::$_"} = \&{"$pkg\::$_"} foreach @_;
66}
67
68# Default methods
69
70sub export_fail {
71 my $self = shift;
72 @_;
73}
74
75# Unfortunately, caller(1)[3] "does not work" if the caller is aliased as
76# *name = \&foo. Thus the need to create a lot of identical subroutines
77# Otherwise we could have aliased them to export().
78
79sub export_to_level {
80 goto &{as_heavy()};
81}
82
83sub export_tags {
84 goto &{as_heavy()};
85}
86
87sub export_ok_tags {
88 goto &{as_heavy()};
89}
90
91sub require_version {
92 goto &{as_heavy()};
93}
94
9511.0e-51.0e-51;
96__END__
97