← Index
NYTProf Performance Profile   « line view »
For bin/benchmark-perlformance
  Run on Fri Apr 17 15:31:48 2015
Reported on Fri Apr 17 15:32:02 2015

Filename/home/ss5/perl5/perlbrew/perls/tapper-perl/lib/5.16.3/Exporter.pm
StatementsExecuted 1073 statements in 3.23ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
6867362.59ms6.68msExporter::::importExporter::import
9311.22ms1.32msExporter::::as_heavyExporter::as_heavy
34921101µs101µsExporter::::CORE:matchExporter::CORE:match (opcode)
3172190µs90µsExporter::::CORE:substExporter::CORE:subst (opcode)
72249µs1.34msExporter::::exportExporter::export
1116µs18µsExporter::::export_to_levelExporter::export_to_level
1116µs20µsExporter::::export_ok_tagsExporter::export_ok_tags
0000s0sExporter::::__ANON__[:64]Exporter::__ANON__[:64]
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
3110µsrequire 5.006;
4
5# Be lean.
6#use strict;
7#no strict 'refs';
8
91300nsour $Debug = 0;
101100nsour $ExportLevel = 0;
111300nsour $Verbose ||= 0;
121500nsour $VERSION = '5.66';
131300nsour (%Cache);
14
15
# spent 1.32ms (1.22+99µs) within Exporter::as_heavy which was called 9 times, avg 146µs/call: # 7 times (1.20ms+93µs) by Exporter::export at line 25, avg 184µs/call # once (11µs+4µs) by Exporter::export_ok_tags at line 89 # once (10µs+3µs) by Exporter::export_to_level at line 81
sub as_heavy {
16979µ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
19929µs my $c = (caller(1))[3];
20965µs927µs $c =~ s/.*:://;
# spent 27µs making 9 calls to Exporter::CORE:subst, avg 3µs/call
21950µs \&{"Exporter::Heavy::heavy_$c"};
22}
23
24
# spent 1.34ms (49µs+1.29) within Exporter::export which was called 7 times, avg 191µs/call: # 6 times (46µs+1.28ms) by Exporter::import at line 62, avg 222µs/call # once (3µs+6µs) by Exporter::Heavy::heavy_export_to_level at line 214 of Exporter/Heavy.pm
sub export {
25764µs143.99ms goto &{as_heavy()};
# spent 2.70ms making 7 calls to Exporter::Heavy::heavy_export, avg 386µs/call # spent 1.29ms making 7 calls to Exporter::as_heavy, avg 184µs/call
26}
27
28
# spent 6.68ms (2.59+4.09) within Exporter::import which was called 68 times, avg 98µs/call: # 2 times (68µs+4µs) by Benchmark::Perl::Formance::BEGIN@16 or Data::DPath::Context::BEGIN@20 at line 34 of List/Util.pm, avg 36µs/call # once (147µs+2.10ms) by POSIX::import at line 30 of POSIX.pm # once (31µs+1.30ms) by Getopt::Long::import at line 114 of Getopt/Long.pm # once (309µs+262µs) by Storable::BEGIN@52 at line 53 of Storable.pm # once (46µs+154µs) by Safe::BEGIN@46 at line 46 of Safe.pm # once (142µs+9µs) by Sys::Info::Base::BEGIN@5 at line 5 of Sys/Info/Base.pm # once (15µs+117µs) by Sys::Info::Base::BEGIN@8 at line 8 of Sys/Info/Base.pm # once (115µs+6µs) by POSIX::BEGIN@11 at line 11 of POSIX.pm # once (107µs+4µs) by Sys::Info::Base::BEGIN@5 at line 147 of IO/File.pm # once (27µs+54µs) by Benchmark::Perl::Formance::BEGIN@22 at line 22 of lib/Benchmark/Perl/Formance.pm # once (74µs+5µs) by Data::Structure::Util::BEGIN@8 at line 8 of Data/Structure/Util.pm # once (64µs+4µs) by Data::DPath::Context::BEGIN@16 at line 16 of Data/DPath/Context.pm # once (53µs+3µs) by Data::DPath::Context::BEGIN@19 at line 19 of Data/DPath/Context.pm # once (49µs+3µs) by Sys::Info::BEGIN@6 at line 6 of Sys/Info.pm # once (44µs+7µs) by Data::DPath::Path::BEGIN@17 at line 17 of Data/DPath/Path.pm # once (46µs+3µs) by Benchmark::Perl::Formance::BEGIN@12 at line 12 of lib/Benchmark/Perl/Formance.pm # once (41µs+2µs) by Data::DPath::Context::BEGIN@17 at line 17 of Data/DPath/Context.pm # once (41µs+3µs) by FindBin::BEGIN@83 at line 83 of FindBin.pm # once (40µs+2µs) by Data::Structure::Util::BEGIN@9 at line 9 of Data/Structure/Util.pm # once (40µs+2µs) by IO::Handle::BEGIN@263 at line 263 of IO/Handle.pm # once (37µs+1µs) by Benchmark::Perl::Formance::BEGIN@18 at line 18 of lib/Benchmark/Perl/Formance.pm # once (35µs+2µs) by Class::XSAccessor::Array::BEGIN@5 at line 5 of Class/XSAccessor/Array.pm # once (36µs+1µs) by Text::Balanced::BEGIN@343 at line 343 of Text/Balanced.pm # once (35µs+2µs) by Tie::Hash::BEGIN@188 at line 188 of Tie/Hash.pm # once (32µs+1µs) by Sub::Install::BEGIN@6 at line 6 of Sub/Install.pm # once (32µs+1µs) by Data::YAML::Writer::BEGIN@5 at line 5 of Data/YAML/Writer.pm # once (31µs+1µs) by Sys::Hostname::BEGIN@5 at line 5 of Sys/Hostname.pm # once (31µs+2µs) by Opcode::BEGIN@11 at line 11 of Opcode.pm # once (30µs+2µs) by IO::Handle::BEGIN@264 at line 264 of IO/Handle.pm # once (29µs+1µs) by Data::Dumper::BEGIN@22 at line 22 of Data/Dumper.pm # once (28µs+1µs) by IO::Seekable::BEGIN@98 at line 98 of IO/Seekable.pm # once (28µs+1µs) by IO::File::BEGIN@130 at line 130 of IO/File.pm # once (27µs+1µs) by Text::Balanced::BEGIN@885 at line 885 of Text/Balanced.pm # once (26µs+1µs) by FindBin::BEGIN@80 at line 80 of FindBin.pm # once (26µs+900ns) by Benchmark::Perl::Formance::BEGIN@19 at line 19 of lib/Benchmark/Perl/Formance.pm # once (26µs+900ns) by Data::OptList::BEGIN@10 at line 95 of Params/Util.pm # once (25µs+900ns) by Devel::StackTrace::BEGIN@13 at line 13 of Devel/StackTrace.pm # once (25µs+1µs) by Safe::BEGIN@29 at line 29 of Safe.pm # once (25µs+1µs) by Class::XSAccessor::Heavy::BEGIN@7 at line 7 of Class/XSAccessor/Heavy.pm # once (25µs+1000ns) by Safe::BEGIN@4 at line 4 of Safe.pm # once (24µs+1µs) by IO::File::BEGIN@131 at line 131 of IO/File.pm # once (24µs+1µs) by SelectSaver::BEGIN@38 at line 38 of SelectSaver.pm # once (24µs+1µs) by Data::DPath::Path::BEGIN@13 at line 13 of Data/DPath/Path.pm # once (24µs+1µs) by FindBin::BEGIN@84 at line 84 of FindBin.pm # once (24µs+1µs) by IO::BEGIN@6 at line 6 of IO.pm # once (24µs+0s) by Cwd::BEGIN@171 at line 171 of Cwd.pm # once (24µs+0s) by Config::Perl::V::BEGIN@9 at line 9 of Config/Perl/V.pm # once (22µs+1µs) by IO::Seekable::BEGIN@104 at line 104 of IO/Seekable.pm # once (22µs+900ns) by SelectSaver::BEGIN@39 at line 39 of SelectSaver.pm # once (22µs+800ns) by Exception::Class::BEGIN@11 at line 11 of Exception/Class.pm # once (21µs+1µs) by IO::File::BEGIN@133 at line 133 of IO/File.pm # once (20µs+900ns) by Benchmark::Perl::Formance::BEGIN@20 at line 20 of lib/Benchmark/Perl/Formance.pm # once (20µs+900ns) by Text::Balanced::BEGIN@9 at line 9 of Text/Balanced.pm # once (20µs+800ns) by Exception::Class::Base::BEGIN@11 at line 11 of Exception/Class/Base.pm # once (19µs+700ns) by Class::XSAccessor::BEGIN@5 at line 5 of Class/XSAccessor.pm # once (18µs+800ns) by Data::DPath::Context::BEGIN@13 at line 13 of Data/DPath/Context.pm # once (18µs+600ns) by Sys::Info::BEGIN@5 at line 5 of Sys/Info.pm # once (18µs+700ns) by Data::DPath::Filters::BEGIN@13 at line 13 of Data/DPath/Filters.pm # once (18µs+500ns) by Sys::Info::Constants::BEGIN@5 at line 5 of Sys/Info/Constants.pm # once (17µs+700ns) by Sys::Info::Base::BEGIN@6 at line 6 of Sys/Info/Base.pm # once (15µs+0s) by Benchmark::Perl::Formance::BEGIN@9 at line 9 of lib/Benchmark/Perl/Formance.pm # once (14µs+0s) by SelfLoader::BEGIN@4 at line 4 of SelfLoader.pm # once (13µs+0s) by SelfLoader::BEGIN@42 at line 42 of SelfLoader.pm # once (12µs+0s) by Benchmark::Perl::Formance::BEGIN@265 at line 265 of lib/Benchmark/Perl/Formance.pm # once (12µs+0s) by Getopt::Long::BEGIN@25 at line 25 of Getopt/Long.pm # once (10µs+0s) by Benchmark::Perl::Formance::BEGIN@10 at line 10 of lib/Benchmark/Perl/Formance.pm # once (10µs+0s) by Data::DPath::Filters::BEGIN@14 at line 14 of Data/DPath/Filters.pm
sub import {
296828µs my $pkg = shift;
306843µs my $callpkg = caller($ExportLevel);
31
326822µs 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 :-(
386897µ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.
416873µs my $fail = ${$pkg . '::'}{EXPORT_FAIL} && \@{"$pkg\::EXPORT_FAIL"};
426833µs return export $pkg, $callpkg, @_
43 if $Verbose or $Debug or $fail && @$fail > 1;
446852µs my $export_cache = ($Cache{$pkg} ||= {});
456892µs my $args = @_ or @_ = @$exports;
46
476824µs if ($args and not %$export_cache) {
48 s/^&//, $export_cache->{$_} = 1
4913591µs30863µs foreach (@$exports, @{"$pkg\::EXPORT_OK"});
# spent 63µs making 308 calls to Exporter::CORE:subst, avg 204ns/call
50 }
51688µs my $heavy;
52 # Try very hard not to use {} and hence have to enter scope on the foreach
53 # We bomb out of the loop with last as soon as heavy is set.
546833µs if ($args or $fail) {
55 ($heavy = (/\W/ or $args and not exists $export_cache->{$_}
56 or $fail and @$fail and $_ eq $fail->[0])) and last
5745409µs15661µs foreach (@_);
# spent 61µs making 156 calls to Exporter::CORE:match, avg 390ns/call
58 } else {
59 ($heavy = /\W/) and last
6023297µs19340µs foreach (@_);
# spent 40µs making 193 calls to Exporter::CORE:match, avg 206ns/call
61 }
626871µs61.33ms return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy;
# spent 1.33ms making 6 calls to Exporter::export, avg 222µs/call
63 local $SIG{__WARN__} =
6462211µs sub {require Carp; &Carp::carp} if not $SIG{__WARN__};
65 # shortcut for the common case of no type character
6662835µs *{"$callpkg\::$_"} = \&{"$pkg\::$_"} foreach @_;
67}
68
69# Default methods
70
71sub export_fail {
72 my $self = shift;
73 @_;
74}
75
76# Unfortunately, caller(1)[3] "does not work" if the caller is aliased as
77# *name = \&foo. Thus the need to create a lot of identical subroutines
78# Otherwise we could have aliased them to export().
79
80
# spent 18µs (6+12) within Exporter::export_to_level which was called: # once (6µs+12µs) by Time::HiRes::import at line 63 of Time/HiRes.pm
sub export_to_level {
8117µs2142µs goto &{as_heavy()};
# spent 129µs making 1 call to Exporter::Heavy::heavy_export_to_level # spent 12µs making 1 call to Exporter::as_heavy
82}
83
84sub export_tags {
85 goto &{as_heavy()};
86}
87
88
# spent 20µs (6+14) within Exporter::export_ok_tags which was called: # once (6µs+14µs) by Data::DPath::Path::BEGIN@17 at line 31 of Text/Balanced.pm
sub export_ok_tags {
8917µs233µs goto &{as_heavy()};
# spent 19µs making 1 call to Exporter::Heavy::heavy_export_ok_tags # spent 14µs making 1 call to Exporter::as_heavy
90}
91
92sub require_version {
93 goto &{as_heavy()};
94}
95
9614µs1;
97__END__
 
# spent 101µs within Exporter::CORE:match which was called 349 times, avg 288ns/call: # 193 times (40µs+0s) by Exporter::import at line 60, avg 206ns/call # 156 times (61µs+0s) by Exporter::import at line 57, avg 390ns/call
sub Exporter::CORE:match; # opcode
# spent 90µs within Exporter::CORE:subst which was called 317 times, avg 285ns/call: # 308 times (63µs+0s) by Exporter::import at line 49, avg 204ns/call # 9 times (27µs+0s) by Exporter::as_heavy at line 20, avg 3µs/call
sub Exporter::CORE:subst; # opcode