← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/local/src/github.com/foswiki/core/bin/view
  Run on Sun Dec 4 17:17:59 2011
Reported on Sun Dec 4 17:26:32 2011

Filename/usr/share/perl/5.14/Exporter.pm
StatementsExecuted 2187 statements in 12.9ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
79563710.1ms25.4msExporter::::importExporter::import
30213.34ms3.69msExporter::::as_heavyExporter::as_heavy
40521735µs735µsExporter::::CORE:substExporter::CORE:subst (opcode)
29621573µs573µsExporter::::CORE:matchExporter::CORE:match (opcode)
2811420µs1.29msExporter::::exportExporter::export
22236µs2.85msExporter::::export_tagsExporter::export_tags
0000s0sExporter::::__ANON__[:65]Exporter::__ANON__[:65]
0000s0sExporter::::export_failExporter::export_fail
0000s0sExporter::::export_ok_tagsExporter::export_ok_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
3120µsrequire 5.006;
4
5# Be lean.
6#use strict;
7#no strict 'refs';
8
912µsour $Debug = 0;
1011µsour $ExportLevel = 0;
1112µsour $Verbose ||= 0;
1212µsour $VERSION = '5.64_03';
1311µsour (%Cache);
14
15
# spent 3.69ms (3.34+344µs) within Exporter::as_heavy which was called 30 times, avg 123µs/call: # 28 times (708µs+166µs) by Exporter::export at line 25, avg 31µs/call # 2 times (2.64ms+178µs) by Exporter::export_tags at line 86, avg 1.41ms/call
sub as_heavy {
161501.19ms 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];
2030185µs $c =~ s/.*:://;
# spent 185µs making 30 calls to Exporter::CORE:subst, avg 6µs/call
21 \&{"Exporter::Heavy::heavy_$c"};
22}
23
24
# spent 1.29ms (420µs+874µs) within Exporter::export which was called 28 times, avg 46µs/call: # 28 times (420µs+874µs) by Exporter::import at line 63, avg 46µs/call
sub export {
2556493µs5613.7ms goto &{as_heavy()};
# spent 12.9ms making 28 calls to Exporter::Heavy::heavy_export, avg 460µs/call # spent 874µs making 28 calls to Exporter::as_heavy, avg 31µs/call
26}
27
28
# spent 25.4ms (10.1+15.3) within Exporter::import which was called 79 times, avg 321µs/call: # 24 times (1.72ms+7.67ms) by Error::import at line 63 of Error.pm, avg 391µs/call # once (55µs+2.69ms) by CGI::Session::Driver::file::BEGIN@9 at line 9 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session/Driver/file.pm # once (54µs+1.78ms) by Foswiki::Store::VC::Handler::BEGIN@34 at line 34 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Store/VC/Handler.pm # once (51µs+1.66ms) by Foswiki::Users::HtPasswdUser::BEGIN@23 at line 23 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Users/HtPasswdUser.pm # once (967µs+89µs) by File::Temp::BEGIN@146 at line 146 of File/Temp.pm # once (899µs+93µs) by Digest::SHA::BEGIN@7 at line 7 of Digest/SHA.pm # once (711µs+195µs) by IO::Seekable::BEGIN@12 at line 12 of IO/Seekable.pm # once (667µs+231µs) by Foswiki::Meta::BEGIN@119 at line 119 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Meta.pm # once (131µs+543µs) by Safe::BEGIN@46 at line 46 of Safe.pm # once (455µs+44µs) by Foswiki::Request::BEGIN@37 at line 26 of IO/File.pm # once (208µs+24µs) by CGI::BEGIN@28 at line 28 of CGI.pm # once (176µs+25µs) by CGI::Carp::import at line 371 of CGI/Carp.pm # once (161µs+31µs) by Foswiki::Sandbox::BEGIN@39 at line 39 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Sandbox.pm # once (153µs+21µs) by Foswiki::Serialise::BEGIN@95 at line 95 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Serialise.pm # once (157µs+6µs) by Time::Local::BEGIN@4 at line 4 of Time/Local.pm # once (131µs+6µs) by IO::Seekable::BEGIN@6 at line 6 of IO/Seekable.pm # once (113µs+15µs) by Foswiki::BEGIN@28 at line 28 of setlib.cfg # once (114µs+13µs) by CGI::BEGIN@3 at line 3 of CGI.pm # once (114µs+6µs) by CGI::Session::Driver::file::BEGIN@7 at line 7 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session/Driver/file.pm # once (113µs+6µs) by Data::Dumper::BEGIN@20 at line 20 of Data/Dumper.pm # once (105µs+7µs) by CGI::Session::Driver::BEGIN@8 at line 8 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session/Driver.pm # once (103µs+6µs) by SelectSaver::BEGIN@7 at line 7 of SelectSaver.pm # once (102µs+7µs) by IO::File::BEGIN@9 at line 9 of IO/File.pm # once (99µs+10µs) by File::Temp::BEGIN@145 at line 145 of File/Temp.pm # once (104µs+6µs) by File::Temp::BEGIN@143 at line 143 of File/Temp.pm # once (102µs+7µs) by Opcode::BEGIN@11 at line 11 of Opcode.pm # once (99µs+6µs) by IO::File::BEGIN@8 at line 8 of IO/File.pm # once (98µs+6µs) by IO::Handle::BEGIN@7 at line 7 of IO/Handle.pm # once (99µs+5µs) by CGI::Session::BEGIN@6 at line 6 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session.pm # once (98µs+6µs) by CGI::Cookie::BEGIN@21 at line 21 of CGI/Cookie.pm # once (96µs+5µs) by IO::Handle::BEGIN@6 at line 6 of IO/Handle.pm # once (94µs+5µs) by CGI::Session::Serialize::default::BEGIN@9 at line 9 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session/Serialize/default.pm # once (95µs+3µs) by Foswiki::Store::Interfaces::QueryAlgorithm::BEGIN@342 at line 342 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Store/Interfaces/QueryAlgorithm.pm # once (94µs+3µs) by Sort::Maker::BEGIN@6 at line 6 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/Sort/Maker.pm # once (91µs+5µs) by SelectSaver::BEGIN@6 at line 6 of SelectSaver.pm # once (90µs+5µs) by Safe::BEGIN@29 at line 29 of Safe.pm # once (90µs+6µs) by Carp::BEGIN@4.1 at line 4 of Carp/Heavy.pm # once (89µs+5µs) by File::Temp::BEGIN@147 at line 147 of File/Temp.pm # once (89µs+5µs) by IO::BEGIN@6 at line 6 of IO.pm # once (84µs+4µs) by Foswiki::Users::HtPasswdUser::BEGIN@2.2 at line 2 of (eval 46)[/usr/local/src/github.com/foswiki/core/lib/Foswiki/Users/HtPasswdUser.pm:50] # once (83µs+5µs) by IO::File::BEGIN@11 at line 11 of IO/File.pm # once (83µs+4µs) by Safe::BEGIN@5 at line 5 of Safe.pm # once (80µs+5µs) by Foswiki::Meta::BEGIN@546 at line 546 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Meta.pm # once (73µs+4µs) by File::Temp::Dir::BEGIN@2405 at line 2405 of File/Temp.pm # once (75µs+0s) by Assert::BEGIN@20 at line 20 of /usr/local/src/github.com/foswiki/core/lib/Assert.pm # once (70µs+3µs) by Foswiki::Templates::BEGIN@483 at line 483 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Templates.pm # once (70µs+3µs) by CGI::Session::Serialize::default::BEGIN@7 at line 7 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session/Serialize/default.pm # once (66µs+0s) by CGI::Carp::BEGIN@333 at line 333 of CGI/Carp.pm # once (62µs+2µs) by CGI::Session::Serialize::default::BEGIN@10 at line 10 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session/Serialize/default.pm # once (61µs+2µs) by File::Path::BEGIN@6 at line 6 of File/Path.pm # once (59µs+2µs) by Foswiki::Request::BEGIN@38 at line 38 of /usr/local/src/github.com/foswiki/core/lib/Foswiki/Request.pm # once (48µs+0s) by Foswiki::Users::HtPasswdUser::BEGIN@2 at line 2 of (eval 45)[/usr/local/src/github.com/foswiki/core/lib/Foswiki/Users/HtPasswdUser.pm:48] # once (43µs+0s) by Crypt::PasswdMD5::BEGIN@65 at line 65 of Crypt/PasswdMD5.pm # once (41µs+0s) by Cwd::BEGIN@171 at line 171 of Cwd.pm # once (40µs+0s) by CGI::Session::ID::md5::BEGIN@6 at line 6 of /usr/local/src/github.com/foswiki/core/lib/CPAN/lib/CGI/Session/ID/md5.pm # once (38µs+0s) by File::Temp::BEGIN@148 at line 148 of File/Temp.pm
sub import {
29197011.2ms 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
50375550µs foreach (@$exports, @{"$pkg\::EXPORT_OK"});
# spent 550µs making 375 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
58204437µs foreach (@_);
# spent 437µs making 204 calls to Exporter::CORE:match, avg 2µs/call
59 } else {
60 ($heavy = /\W/) and last
6192136µs foreach (@_);
# spent 136µs making 92 calls to Exporter::CORE:match, avg 1µs/call
62 }
63281.29ms return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy;
# spent 1.29ms making 28 calls to Exporter::export, avg 46µ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
85
# spent 2.85ms (36µs+2.81) within Exporter::export_tags which was called 2 times, avg 1.43ms/call: # once (21µs+2.78ms) by Foswiki::BEGIN@46 at line 31 of /usr/local/src/github.com/foswiki/core/lib/Assert.pm # once (14µs+33µs) by Foswiki::Sandbox::BEGIN@39 at line 202 of File/Temp.pm
sub export_tags {
86445µs42.93ms goto &{as_heavy()};
# spent 2.81ms making 2 calls to Exporter::as_heavy, avg 1.41ms/call # spent 118µs making 2 calls to Exporter::Heavy::heavy_export_tags, avg 59µs/call
87}
88
89sub export_ok_tags {
90 goto &{as_heavy()};
91}
92
93sub require_version {
94 goto &{as_heavy()};
95}
96
9718µs1;
98__END__
 
# spent 573µs within Exporter::CORE:match which was called 296 times, avg 2µs/call: # 204 times (437µs+0s) by Exporter::import at line 58, avg 2µs/call # 92 times (136µs+0s) by Exporter::import at line 61, avg 1µs/call
sub Exporter::CORE:match; # opcode
# spent 735µs within Exporter::CORE:subst which was called 405 times, avg 2µs/call: # 375 times (550µs+0s) by Exporter::import at line 50, avg 1µs/call # 30 times (185µs+0s) by Exporter::as_heavy at line 20, avg 6µs/call
sub Exporter::CORE:subst; # opcode