← Index
NYTProf Performance Profile   « block view • line view • sub view »
For reply.pl
  Run on Thu Oct 21 22:40:13 2010
Reported on Thu Oct 21 22:44:38 2010

Filename/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/Exporter.pm
StatementsExecuted 876 statements in 4.58ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
5050283.12ms6.02msExporter::::importExporter::import
18211.63ms1.79msExporter::::as_heavyExporter::as_heavy
1711539µs803µsExporter::::exportExporter::export
26721324µs324µsExporter::::CORE:substExporter::CORE:subst (opcode)
5521102µs102µsExporter::::CORE:matchExporter::CORE:match (opcode)
11110µs1.53msExporter::::export_ok_tagsExporter::export_ok_tags
0000s0sExporter::::__ANON__[:65]Exporter::__ANON__[:65]
0000s0sExporter::::export_failExporter::export_fail
0000s0sExporter::::export_tagsExporter::export_tags
0000s0sExporter::::export_to_levelExporter::export_to_level
0000s0sExporter::::require_versionExporter::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;
2
3116µsrequire 5.006;
4
5# Be lean.
6#use strict;
7#no strict 'refs';
8
911µsour $Debug = 0;
1011µsour $ExportLevel = 0;
111700nsour $Verbose ||= 0;
1211µsour $VERSION = '5.64_03';
1311µsour (%Cache);
14
15
# spent 1.79ms (1.63+159µs) within Exporter::as_heavy which was called 18 times, avg 99µs/call: # 17 times (213µs+51µs) by Exporter::export at line 25, avg 16µs/call # once (1.42ms+108µs) by Exporter::export_ok_tags at line 90
sub as_heavy {
1672444µs require Exporter::Heavy;
17 # Unfortunately, this does not work if the caller is aliased as *name = \&foo
18 # Thus the need to create a lot of identical subroutines
19 my $c = (caller(1))[3];
201856µs $c =~ s/.*:://;
# spent 56µs making 18 calls to Exporter::CORE:subst, avg 3µs/call
21 \&{"Exporter::Heavy::heavy_$c"};
22}
23
24
# spent 803µs (539+264) within Exporter::export which was called 17 times, avg 47µs/call: # 17 times (539µs+264µs) by Exporter::import at line 63, avg 47µs/call
sub export {
2517144µs342.00ms goto &{as_heavy()};
# spent 1.73ms making 17 calls to Exporter::Heavy::heavy_export, avg 102µs/call # spent 264µs making 17 calls to Exporter::as_heavy, avg 16µs/call
26}
27
28
# spent 6.02ms (3.12+2.91) within Exporter::import which was called 50 times, avg 120µs/call: # once (178µs+590µs) by Regexp::Common::URI::RFC2806::BEGIN@4 at line 4 of Regexp/Common/URI/RFC2806.pm # once (193µs+158µs) by Regexp::Common::URI::file::BEGIN@5 at line 5 of Regexp/Common/URI/file.pm # once (178µs+140µs) by Regexp::Common::URI::fax::BEGIN@5 at line 5 of Regexp/Common/URI/fax.pm # once (159µs+142µs) by Regexp::Common::URI::gopher::BEGIN@6 at line 6 of Regexp/Common/URI/gopher.pm # once (188µs+38µs) by Hailo::Engine::Default::BEGIN@12 at line 12 of Hailo/Engine/Default.pm # once (37µs+185µs) by Regexp::Common::URI::prospero::BEGIN@5 at line 5 of Regexp/Common/URI/prospero.pm # once (32µs+168µs) by Regexp::Common::URI::news::BEGIN@5 at line 5 of Regexp/Common/URI/news.pm # once (32µs+163µs) by Regexp::Common::URI::wais::BEGIN@5 at line 5 of Regexp/Common/URI/wais.pm # once (82µs+113µs) by Regexp::Common::URI::pop::BEGIN@6 at line 6 of Regexp/Common/URI/pop.pm # once (73µs+119µs) by Regexp::Common::URI::RFC2806::BEGIN@3 at line 3 of Regexp/Common/URI/RFC2806.pm # once (35µs+158µs) by Regexp::Common::URI::ftp::BEGIN@5 at line 5 of Regexp/Common/URI/ftp.pm # once (32µs+147µs) by Regexp::Common::URI::telnet::BEGIN@5 at line 5 of Regexp/Common/URI/telnet.pm # once (33µs+142µs) by Regexp::Common::URI::gopher::BEGIN@5 at line 5 of Regexp/Common/URI/gopher.pm # once (33µs+139µs) by Regexp::Common::URI::http::BEGIN@5 at line 5 of Regexp/Common/URI/http.pm # once (31µs+124µs) by Regexp::Common::URI::RFC2384::BEGIN@5 at line 5 of Regexp/Common/URI/RFC2384.pm # once (32µs+103µs) by Regexp::Common::URI::tel::BEGIN@5 at line 5 of Regexp/Common/URI/tel.pm # once (31µs+96µs) by Regexp::Common::URI::pop::BEGIN@5 at line 5 of Regexp/Common/URI/pop.pm # once (105µs+16µs) by Tie::RefHash::BEGIN@106 at line 111 of Tie/RefHash.pm # once (31µs+81µs) by Regexp::Common::URI::tv::BEGIN@8 at line 8 of Regexp/Common/URI/tv.pm # once (94µs+3µs) by Mouse::BEGIN@8 at line 8 of Mouse.pm # once (86µs+5µs) by Hailo::Engine::Default::BEGIN@11 at line 11 of Hailo/Engine/Default.pm # once (74µs+11µs) by Hailo::BEGIN@14 at line 14 of Hailo.pm # once (68µs+8µs) by Tie::RefHash::BEGIN@94 at line 94 of Tie/RefHash.pm # once (70µs+4µs) by Regexp::Common::URI::fax::BEGIN@4 at line 4 of Regexp/Common/URI/fax.pm # once (67µs+5µs) by Fatal::BEGIN@4 at line 4 of Fatal.pm # once (67µs+5µs) by Sub::Install::BEGIN@6 at line 6 of Sub/Install.pm # once (60µs+6µs) by namespace::clean::BEGIN@15 at line 15 of namespace/clean.pm # once (59µs+5µs) by namespace::clean::BEGIN@14 at line 14 of namespace/clean.pm # once (59µs+4µs) by Tie::Hash::BEGIN@188 at line 188 of Tie/Hash.pm # once (53µs+2µs) by Mouse::Role::BEGIN@6 at line 6 of Mouse/Role.pm # once (51µs+1µs) by Hailo::BEGIN@13 at line 13 of Hailo.pm # once (47µs+2µs) by Hailo::Tokenizer::Words::BEGIN@14 at line 14 of Hailo/Tokenizer/Words.pm # once (46µs+2µs) by Regexp::Common::URI::prospero::BEGIN@4 at line 4 of Regexp/Common/URI/prospero.pm # once (48µs+0s) by Hailo::Storage::BEGIN@12 at line 12 of Hailo/Storage.pm # once (44µs+2µs) by Package::Stash::BEGIN@9 at line 9 of Package/Stash.pm # once (44µs+2µs) by Regexp::Common::URI::tv::BEGIN@7 at line 7 of Regexp/Common/URI/tv.pm # once (44µs+2µs) by Regexp::Common::URI::ftp::BEGIN@4 at line 4 of Regexp/Common/URI/ftp.pm # once (44µs+2µs) by Regexp::Common::URI::gopher::BEGIN@4 at line 4 of Regexp/Common/URI/gopher.pm # once (42µs+2µs) by Regexp::Common::URI::file::BEGIN@4 at line 4 of Regexp/Common/URI/file.pm # once (42µs+2µs) by Regexp::Common::URI::http::BEGIN@4 at line 4 of Regexp/Common/URI/http.pm # once (42µs+1µs) by Regexp::Common::URI::telnet::BEGIN@4 at line 4 of Regexp/Common/URI/telnet.pm # once (41µs+2µs) by Regexp::Common::URI::pop::BEGIN@4 at line 4 of Regexp/Common/URI/pop.pm # once (41µs+1µs) by Regexp::Common::URI::wais::BEGIN@4 at line 4 of Regexp/Common/URI/wais.pm # once (41µs+2µs) by Regexp::Common::URI::news::BEGIN@4 at line 4 of Regexp/Common/URI/news.pm # once (41µs+2µs) by Regexp::Common::URI::tel::BEGIN@4 at line 4 of Regexp/Common/URI/tel.pm # once (41µs+2µs) by Package::Stash::BEGIN@10 at line 10 of Package/Stash.pm # once (40µs+2µs) by Mouse::BEGIN@9 at line 9 of Mouse.pm # once (40µs+2µs) by Mouse::Role::BEGIN@7 at line 7 of Mouse/Role.pm # once (33µs+0s) by Sub::Identify::BEGIN@4 at line 4 of Sub/Identify.pm # once (33µs+0s) by B::Hooks::EndOfScope::BEGIN@14 at line 14 of B/Hooks/EndOfScope.pm
sub import {
297793.96ms my $pkg = shift;
30 my $callpkg = caller($ExportLevel);
31
32 if ($pkg eq "Exporter" and @_ and $_[0] eq "import") {
33 *{$callpkg."::import"} = \&import;
34 return;
35 }
36
37 # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-(
38 my $exports = \@{"$pkg\::EXPORT"};
39 # But, avoid creating things if they don't exist, which saves a couple of
40 # hundred bytes per package processed.
41 my $fail = ${$pkg . '::'}{EXPORT_FAIL} && \@{"$pkg\::EXPORT_FAIL"};
42 return export $pkg, $callpkg, @_
43 if $Verbose or $Debug or $fail && @$fail > 1;
44 my $export_cache = ($Cache{$pkg} ||= {});
45 my $args = @_ or @_ = @$exports;
46
47 local $_;
48 if ($args and not %$export_cache) {
49 s/^&//, $export_cache->{$_} = 1
50249267µs foreach (@$exports, @{"$pkg\::EXPORT_OK"});
# spent 267µs making 249 calls to Exporter::CORE:subst, avg 1µs/call
51 }
52 my $heavy;
53 # Try very hard not to use {} and hence have to enter scope on the foreach
54 # We bomb out of the loop with last as soon as heavy is set.
55 if ($args or $fail) {
56 ($heavy = (/\W/ or $args and not exists $export_cache->{$_}
57 or $fail and @$fail and $_ eq $fail->[0])) and last
5854100µs foreach (@_);
# spent 100µs making 54 calls to Exporter::CORE:match, avg 2µs/call
59 } else {
60 ($heavy = /\W/) and last
6112µs foreach (@_);
# spent 2µs making 1 call to Exporter::CORE:match
62 }
6317803µs return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy;
# spent 803µs making 17 calls to Exporter::export, avg 47µs/call
64 local $SIG{__WARN__} =
65 sub {require Carp; &Carp::carp} if not $SIG{__WARN__};
66 # shortcut for the common case of no type character
67 *{"$callpkg\::$_"} = \&{"$pkg\::$_"} foreach @_;
68}
69
70# Default methods
71
72sub export_fail {
73 my $self = shift;
74 @_;
75}
76
77# Unfortunately, caller(1)[3] "does not work" if the caller is aliased as
78# *name = \&foo. Thus the need to create a lot of identical subroutines
79# Otherwise we could have aliased them to export().
80
81sub export_to_level {
82 goto &{as_heavy()};
83}
84
85sub export_tags {
86 goto &{as_heavy()};
87}
88
89
# spent 1.53ms (10µs+1.53) within Exporter::export_ok_tags which was called: # once (10µs+1.53ms) by DBI::BEGIN@163 at line 266 of DBI.pm
sub export_ok_tags {
90112µs21.57ms goto &{as_heavy()};
# spent 1.53ms making 1 call to Exporter::as_heavy # spent 46µs making 1 call to Exporter::Heavy::heavy_export_ok_tags
91}
92
93sub require_version {
94 goto &{as_heavy()};
95}
96
9714µs1;
98__END__
 
# spent 102µs within Exporter::CORE:match which was called 55 times, avg 2µs/call: # 54 times (100µs+0s) by Exporter::import at line 58, avg 2µs/call # once (2µs+0s) by Exporter::import at line 61
sub Exporter::CORE:match; # opcode
# spent 324µs within Exporter::CORE:subst which was called 267 times, avg 1µs/call: # 249 times (267µs+0s) by Exporter::import at line 50, avg 1µs/call # 18 times (56µs+0s) by Exporter::as_heavy at line 20, avg 3µs/call
sub Exporter::CORE:subst; # opcode