← Index
NYTProf Performance Profile   « block view • line view • sub view »
For bin/hailo
  Run on Thu Oct 21 22:50:37 2010
Reported on Thu Oct 21 22:52:11 2010

Filename/home/hinrik/perl5/perlbrew/perls/perl-5.13.5/lib/5.13.5/Exporter.pm
StatementsExecuted 1298 statements in 6.42ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
7575434.84ms9.57msExporter::::importExporter::import
25311.68ms1.87msExporter::::as_heavyExporter::as_heavy
47521565µs565µsExporter::::CORE:substExporter::CORE:subst (opcode)
9321162µs162µsExporter::::CORE:matchExporter::CORE:match (opcode)
2222150µs1.95msExporter::::exportExporter::export
21116µs57µsExporter::::export_to_levelExporter::export_to_level
11111µs44µsExporter::::export_ok_tagsExporter::export_ok_tags
0000s0sExporter::::__ANON__[:65]Exporter::__ANON__[:65]
0000s0sExporter::::export_failExporter::export_fail
0000s0sExporter::::export_tagsExporter::export_tags
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
3119µsrequire 5.006;
4
5# Be lean.
6#use strict;
7#no strict 'refs';
8
911µsour $Debug = 0;
1011µsour $ExportLevel = 0;
1111µsour $Verbose ||= 0;
1211µsour $VERSION = '5.64_03';
1311µsour (%Cache);
14
15
# spent 1.87ms (1.68+187µs) within Exporter::as_heavy which was called 25 times, avg 75µs/call: # 22 times (1.63ms+170µs) by Exporter::export at line 25, avg 82µs/call # 2 times (33µs+9µs) by Exporter::export_to_level at line 82, avg 21µs/call # once (25µs+8µs) by Exporter::export_ok_tags at line 90
sub as_heavy {
1625180µ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
192578µs my $c = (caller(1))[3];
2025172µs2578µs $c =~ s/.*:://;
# spent 78µs making 25 calls to Exporter::CORE:subst, avg 3µs/call
2125137µs \&{"Exporter::Heavy::heavy_$c"};
22}
23
24
# spent 1.95ms (150µs+1.80) within Exporter::export which was called 22 times, avg 88µs/call: # 20 times (136µs+1.77ms) by Exporter::import at line 63, avg 95µs/call # 2 times (14µs+26µs) by Exporter::Heavy::heavy_export_to_level at line 214 of Exporter/Heavy.pm, avg 20µs/call
sub export {
2522191µs444.30ms goto &{as_heavy()};
# spent 2.50ms making 22 calls to Exporter::Heavy::heavy_export, avg 114µs/call # spent 1.80ms making 22 calls to Exporter::as_heavy, avg 82µs/call
26}
27
28
# spent 9.57ms (4.84+4.72) within Exporter::import which was called 75 times, avg 128µs/call: # once (46µs+1.60ms) by Getopt::Long::import at line 113 of Getopt/Long.pm # once (492µs+304µs) by Term::Sk::BEGIN@7 at line 7 of Term/Sk.pm # once (101µs+303µs) by Getopt::Long::Descriptive::BEGIN@9 at line 9 of Getopt/Long/Descriptive.pm # once (178µs+163µs) by Regexp::Common::URI::RFC2806::BEGIN@4 at line 4 of Regexp/Common/URI/RFC2806.pm # once (178µs+156µs) by Regexp::Common::URI::file::BEGIN@5 at line 5 of Regexp/Common/URI/file.pm # once (167µs+139µs) by Regexp::Common::URI::gopher::BEGIN@6 at line 6 of Regexp/Common/URI/gopher.pm # once (165µs+137µs) by Regexp::Common::URI::fax::BEGIN@5 at line 5 of Regexp/Common/URI/fax.pm # once (199µs+39µs) by hailo::BEGIN@7 at line 7 of bin/hailo # once (36µs+177µs) by Regexp::Common::URI::wais::BEGIN@5 at line 5 of Regexp/Common/URI/wais.pm # once (75µs+129µs) by Regexp::Common::URI::RFC2806::BEGIN@3 at line 3 of Regexp/Common/URI/RFC2806.pm # once (34µs+168µs) by Regexp::Common::URI::prospero::BEGIN@5 at line 5 of Regexp/Common/URI/prospero.pm # once (31µs+169µs) by Regexp::Common::URI::news::BEGIN@5 at line 5 of Regexp/Common/URI/news.pm # once (81µs+113µs) by Regexp::Common::URI::pop::BEGIN@6 at line 6 of Regexp/Common/URI/pop.pm # once (33µs+147µs) by Regexp::Common::URI::ftp::BEGIN@5 at line 5 of Regexp/Common/URI/ftp.pm # once (34µs+145µs) by Regexp::Common::URI::http::BEGIN@5 at line 5 of Regexp/Common/URI/http.pm # once (142µs+33µs) by Hailo::Engine::Default::BEGIN@6 at line 6 of lib/Hailo/Engine/Default.pm # once (32µs+137µs) by Regexp::Common::URI::telnet::BEGIN@5 at line 5 of Regexp/Common/URI/telnet.pm # once (32µs+118µs) by Regexp::Common::URI::gopher::BEGIN@5 at line 5 of Regexp/Common/URI/gopher.pm # once (32µs+117µs) by Regexp::Common::URI::RFC2384::BEGIN@5 at line 5 of Regexp/Common/URI/RFC2384.pm # once (31µs+101µs) by Regexp::Common::URI::tel::BEGIN@5 at line 5 of Regexp/Common/URI/tel.pm # once (32µs+96µs) by Regexp::Common::URI::pop::BEGIN@5 at line 5 of Regexp/Common/URI/pop.pm # once (31µs+80µs) by Regexp::Common::URI::tv::BEGIN@8 at line 8 of Regexp/Common/URI/tv.pm # once (84µs+15µs) by Mouse::BEGIN@9 at line 9 of Mouse.pm # once (86µs+11µs) by Mouse::BEGIN@8 at line 8 of Mouse.pm # once (84µs+6µs) by Encode::BEGIN@48 at line 48 of Encode.pm # once (77µs+10µs) by Getopt::Long::Descriptive::BEGIN@8 at line 8 of Getopt/Long/Descriptive.pm # once (73µs+4µs) by IO::Interactive::BEGIN@7 at line 7 of IO/Interactive.pm # once (67µs+5µs) by Sub::Install::BEGIN@6 at line 6 of Sub/Install.pm # once (68µ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 (64µs+5µs) by namespace::clean::BEGIN@14 at line 14 of namespace/clean.pm # once (67µs+2µs) by IO::Interactive::BEGIN@8 at line 8 of IO/Interactive.pm # once (62µs+7µs) by namespace::clean::BEGIN@15 at line 15 of namespace/clean.pm # once (62µs+5µs) by IO::Handle::BEGIN@264 at line 264 of IO/Handle.pm # once (62µs+4µs) by Hailo::Engine::Default::BEGIN@5 at line 5 of lib/Hailo/Engine/Default.pm # once (61µs+5µs) by Hailo::Command::__ANON__[lib/Hailo/Command.pm:307] at line 303 of lib/Hailo/Command.pm # once (60µs+3µs) by Getopt::Long::Descriptive::Opts::BEGIN@5 at line 5 of Getopt/Long/Descriptive/Opts.pm # once (57µs+4µs) by IO::Handle::BEGIN@263 at line 263 of IO/Handle.pm # once (55µs+5µs) by SelectSaver::BEGIN@39 at line 39 of SelectSaver.pm # once (55µs+4µs) by SelectSaver::BEGIN@38 at line 38 of SelectSaver.pm # once (55µs+4µs) by Tie::Hash::BEGIN@188 at line 188 of Tie/Hash.pm # once (54µs+4µs) by IO::BEGIN@6 at line 6 of IO.pm # once (53µs+4µs) by IO::Interactive::BEGIN@115 at line 115 of IO/Interactive.pm # once (52µs+3µs) by Getopt::Long::Descriptive::BEGIN@5 at line 5 of Getopt/Long/Descriptive.pm # once (53µs+0s) by Hailo::Storage::BEGIN@6 at line 6 of lib/Hailo/Storage.pm # once (49µs+2µs) by Hailo::BEGIN@7 at line 7 of lib/Hailo.pm # once (47µs+2µs) by Regexp::Common::URI::file::BEGIN@4 at line 4 of Regexp/Common/URI/file.pm # once (46µs+2µs) by Hailo::Tokenizer::Words::BEGIN@8 at line 8 of lib/Hailo/Tokenizer/Words.pm # once (45µs+2µs) by File::CountLines::BEGIN@11 at line 11 of File/CountLines.pm # once (43µs+2µs) by Regexp::Common::URI::wais::BEGIN@4 at line 4 of Regexp/Common/URI/wais.pm # once (42µs+2µs) by Mouse::Role::BEGIN@6 at line 6 of Mouse/Role.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+2µs) by Tie::RefHash::BEGIN@106 at line 111 of Tie/RefHash.pm # once (42µs+2µs) by Regexp::Common::URI::telnet::BEGIN@4 at line 4 of Regexp/Common/URI/telnet.pm # once (42µ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::prospero::BEGIN@4 at line 4 of Regexp/Common/URI/prospero.pm # once (41µs+2µs) by Package::Stash::BEGIN@9 at line 9 of Package/Stash.pm # once (41µs+2µs) by Regexp::Common::URI::ftp::BEGIN@4 at line 4 of Regexp/Common/URI/ftp.pm # once (41µs+2µs) by Getopt::Long::Descriptive::Usage::BEGIN@7 at line 7 of Getopt/Long/Descriptive/Usage.pm # once (41µs+2µs) by Tie::RefHash::BEGIN@94 at line 94 of Tie/RefHash.pm # once (41µs+2µs) by Regexp::Common::URI::tv::BEGIN@7 at line 7 of Regexp/Common/URI/tv.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+1µs) by Package::Stash::BEGIN@10 at line 10 of Package/Stash.pm # once (41µs+1µs) by Regexp::Common::URI::pop::BEGIN@4 at line 4 of Regexp/Common/URI/pop.pm # once (40µs+2µs) by Mouse::Role::BEGIN@7 at line 7 of Mouse/Role.pm # once (40µs+2µs) by Hailo::BEGIN@8 at line 8 of lib/Hailo.pm # once (39µs+0s) by Cwd::BEGIN@171 at line 171 of Cwd.pm # once (36µs+0s) by IO::Interactive::BEGIN@76 at line 76 of IO/Interactive.pm # once (35µs+0s) by File::CountLines::BEGIN@8 at line 8 of File/CountLines.pm # once (34µs+0s) by Getopt::Long::BEGIN@25 at line 25 of Getopt/Long.pm # once (33µs+0s) by B::Hooks::EndOfScope::BEGIN@14 at line 14 of B/Hooks/EndOfScope.pm # once (33µs+0s) by Params::Validate::BEGIN@6 at line 6 of Params/Validate.pm # once (31µs+0s) by Sub::Identify::BEGIN@4 at line 4 of Sub/Identify.pm # once (14µs+0s) by Hailo::Command::__ANON__[lib/Hailo/Command.pm:307] at line 9 of File/CountLines.pm
sub import {
2975115µs my $pkg = shift;
3075114µs my $callpkg = caller($ExportLevel);
31
327595µs if ($pkg eq "Exporter" and @_ and $_[0] eq "import") {
3315µs *{$callpkg."::import"} = \&import;
3416µs return;
35 }
36
37 # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-(
3874208µs 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.
4174190µs my $fail = ${$pkg . '::'}{EXPORT_FAIL} && \@{"$pkg\::EXPORT_FAIL"};
4274103µs return export $pkg, $callpkg, @_
43 if $Verbose or $Debug or $fail && @$fail > 1;
4474140µs my $export_cache = ($Cache{$pkg} ||= {});
4574114µs my $args = @_ or @_ = @$exports;
46
477479µs local $_;
4874112µs if ($args and not %$export_cache) {
49 s/^&//, $export_cache->{$_} = 1
50172.03ms450487µs foreach (@$exports, @{"$pkg\::EXPORT_OK"});
# spent 487µs making 450 calls to Exporter::CORE:subst, avg 1µs/call
51 }
527463µs 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.
5574160µs 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
5861646µs81141µs foreach (@_);
# spent 141µs making 81 calls to Exporter::CORE:match, avg 2µs/call
59 } else {
60 ($heavy = /\W/) and last
6113106µs1220µs foreach (@_);
# spent 20µs making 12 calls to Exporter::CORE:match, avg 2µs/call
62 }
6374221µs201.91ms return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy;
# spent 1.91ms making 20 calls to Exporter::export, avg 95µs/call
64 local $SIG{__WARN__} =
6554276µs sub {require Carp; &Carp::carp} if not $SIG{__WARN__};
66 # shortcut for the common case of no type character
6754810µs *{"$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
81
# spent 57µs (16+41) within Exporter::export_to_level which was called 2 times, avg 28µs/call: # 2 times (16µs+41µs) by Time::HiRes::import at line 62 of Time/HiRes.pm, avg 28µs/call
sub export_to_level {
82222µs4453µs goto &{as_heavy()};
# spent 412µs making 2 calls to Exporter::Heavy::heavy_export_to_level, avg 206µs/call # spent 41µs making 2 calls to Exporter::as_heavy, avg 21µs/call
83}
84
85sub export_tags {
86 goto &{as_heavy()};
87}
88
89
# spent 44µs (11+34) within Exporter::export_ok_tags which was called: # once (11µs+34µs) by DBI::BEGIN@163 at line 266 of DBI.pm
sub export_ok_tags {
90116µs283µs goto &{as_heavy()};
# spent 50µs making 1 call to Exporter::Heavy::heavy_export_ok_tags # spent 34µs making 1 call to Exporter::as_heavy
91}
92
93sub require_version {
94 goto &{as_heavy()};
95}
96
9714µs1;
98__END__
 
# spent 162µs within Exporter::CORE:match which was called 93 times, avg 2µs/call: # 81 times (141µs+0s) by Exporter::import at line 58, avg 2µs/call # 12 times (20µs+0s) by Exporter::import at line 61, avg 2µs/call
sub Exporter::CORE:match; # opcode
# spent 565µs within Exporter::CORE:subst which was called 475 times, avg 1µs/call: # 450 times (487µs+0s) by Exporter::import at line 50, avg 1µs/call # 25 times (78µs+0s) by Exporter::as_heavy at line 20, avg 3µs/call
sub Exporter::CORE:subst; # opcode