← Index
NYTProf Performance Profile   « line view »
For /usr/sbin/pkg_info
  Run on Fri Aug 4 10:12:01 2017
Reported on Fri Aug 4 10:12:17 2017

Filename/usr/libdata/perl5/Exporter.pm
StatementsExecuted 787 statements in 11.2ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
50502610.1ms13.9msExporter::::importExporter::import
10211.64ms1.76msExporter::::as_heavyExporter::as_heavy
35521348µs348µsExporter::::CORE:matchExporter::CORE:match (opcode)
29421239µs239µsExporter::::CORE:substExporter::CORE:subst (opcode)
81166µs1.79msExporter::::exportExporter::export
22218µs58µsExporter::::export_ok_tagsExporter::export_ok_tags
0000s0sExporter::::__ANON__[:64]Exporter::__ANON__[:64]
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
3121µsrequire 5.006;
4
5# Be lean.
6#use strict;
7#no strict 'refs';
8
911µsour $Debug = 0;
101800nsour $ExportLevel = 0;
111900nsour $Verbose ||= 0;
1212µsour $VERSION = '5.72';
13our (%Cache);
14
15
# spent 1.76ms (1.64+122µs) within Exporter::as_heavy which was called 10 times, avg 176µs/call: # 8 times (1.61ms+113µs) by Exporter::export at line 25, avg 215µs/call # 2 times (32µs+9µs) by Exporter::export_ok_tags at line 89, avg 20µs/call
sub as_heavy {
1610113µ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
191058µs my $c = (caller(1))[3];
201081µs1044µs $c =~ s/.*:://;
# spent 44µs making 10 calls to Exporter::CORE:subst, avg 4µs/call
211066µs \&{"Exporter::Heavy::heavy_$c"};
22}
23
24
# spent 1.79ms (66µs+1.72) within Exporter::export which was called 8 times, avg 223µs/call: # 8 times (66µs+1.72ms) by Exporter::import at line 62, avg 223µs/call
sub export {
258104µs163.12ms goto &{as_heavy()};
# spent 1.72ms making 8 calls to Exporter::as_heavy, avg 215µs/call # spent 1.40ms making 8 calls to Exporter::Heavy::heavy_export, avg 175µs/call
26}
27
28
# spent 13.9ms (10.1+3.73) within Exporter::import which was called 50 times, avg 277µs/call: # once (5.13ms+282µs) by IO::Uncompress::Gunzip::BEGIN@16 at line 16 of IO/Uncompress/Gunzip.pm # once (401µs+1.80ms) by OpenBSD::PackageInfo::BEGIN@39 at line 39 of OpenBSD/PackageInfo.pm # once (148µs+605µs) by File::Glob::import at line 46 of File/Glob.pm # once (495µs+44µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 8 of IO/Uncompress/RawInflate.pm # once (423µs+24µs) by IO::Compress::Base::Common::BEGIN@8 at line 8 of IO/Compress/Base/Common.pm # once (368µs+28µs) by Compress::Raw::Zlib::BEGIN@6 at line 6 of Compress/Raw/Zlib.pm # once (79µs+231µs) by IO::Compress::Zlib::Extra::BEGIN@13 at line 13 of IO/Compress/Zlib/Extra.pm # once (105µs+156µs) by IO::Uncompress::RawInflate::BEGIN@9 at line 9 of IO/Uncompress/RawInflate.pm # once (214µs+17µs) by OpenBSD::PackageRepository::Installed::BEGIN@197 at line 198 of OpenBSD/PackageRepository/Installed.pm # once (185µs+26µs) by IO::Uncompress::Base::BEGIN@17 at line 17 of IO/Uncompress/Base.pm # once (180µs+20µs) by IO::Uncompress::Base::BEGIN@19 at line 147 of IO/File.pm # once (165µs+21µs) by IO::Uncompress::Base::BEGIN@19 at line 19 of IO/Uncompress/Base.pm # once (155µs+30µs) by IO::Uncompress::Adapter::Inflate::BEGIN@8 at line 8 of IO/Uncompress/Adapter/Inflate.pm # once (159µs+8µs) by OpenBSD::State::BEGIN@86 at line 86 of OpenBSD/State.pm # once (26µs+127µs) by IO::Uncompress::Adapter::Inflate::BEGIN@7 at line 7 of IO/Uncompress/Adapter/Inflate.pm # once (23µs+110µs) by IO::Uncompress::Gunzip::BEGIN@15 at line 15 of IO/Uncompress/Gunzip.pm # once (116µs+12µs) by OpenBSD::PkgInfo::BEGIN@177 at line 177 of OpenBSD/PkgInfo.pm # once (116µs+12µs) by OpenBSD::PackageLocation::BEGIN@23 at line 23 of OpenBSD/PackageLocation.pm # once (116µs+9µs) by OpenBSD::State::BEGIN@88 at line 88 of OpenBSD/State.pm # once (112µs+12µs) by OpenBSD::PkgInfo::State::BEGIN@65 at line 65 of OpenBSD/PkgInfo.pm # once (87µs+6µs) by OpenBSD::Error::BEGIN@72 at line 72 of OpenBSD/Error.pm # once (24µs+65µs) by OpenBSD::Getopt::getopts at line 85 of OpenBSD/Getopt.pm # once (84µs+5µs) by IO::Compress::Base::Common::BEGIN@7 at line 7 of IO/Compress/Base/Common.pm # once (79µs+4µs) by File::GlobMapper::BEGIN@5 at line 5 of File/GlobMapper.pm # once (63µs+8µs) by File::Path::BEGIN@6 at line 6 of File/Path.pm # once (64µs+5µs) by OpenBSD::PackageRepository::Local::BEGIN@454 at line 454 of OpenBSD/PackageRepository.pm # once (61µs+5µs) by OpenBSD::PackageRepository::BEGIN@32 at line 32 of OpenBSD/PackageRepository.pm # once (60µs+5µs) by OpenBSD::PackageLocation::BEGIN@25 at line 25 of OpenBSD/PackageLocation.pm # once (60µs+4µs) by IO::Compress::Base::Common::BEGIN@523 at line 523 of IO/Compress/Base/Common.pm # once (57µs+5µs) by OpenBSD::Temp::BEGIN@25 at line 25 of OpenBSD/Temp.pm # once (55µs+5µs) by OpenBSD::PkgInfo::BEGIN@180 at line 180 of OpenBSD/PkgInfo.pm # once (56µs+3µs) by IO::File::BEGIN@130 at line 130 of IO/File.pm # once (51µs+4µs) by IO::File::BEGIN@131 at line 131 of IO/File.pm # once (49µs+3µs) by IO::Seekable::BEGIN@104 at line 104 of IO/Seekable.pm # once (43µs+7µs) by IO::Handle::BEGIN@266 at line 266 of IO/Handle.pm # once (45µs+3µs) by IO::Handle::BEGIN@267 at line 267 of IO/Handle.pm # once (44µs+3µs) by IO::Seekable::BEGIN@98 at line 98 of IO/Seekable.pm # once (44µs+2µs) by SelectSaver::BEGIN@38 at line 38 of SelectSaver.pm # once (40µs+3µs) by IO::Uncompress::Base::BEGIN@20 at line 20 of IO/Uncompress/Base.pm # once (40µs+3µs) by IO::File::BEGIN@133 at line 133 of IO/File.pm # once (40µs+2µs) by IO::BEGIN@6 at line 6 of IO.pm # once (40µs+3µs) by SelectSaver::BEGIN@39 at line 39 of SelectSaver.pm # once (38µs+2µs) by OpenBSD::Temp::BEGIN@23 at line 23 of OpenBSD/Temp.pm # once (40µs+0s) by Cwd::BEGIN@3 at line 3 of Cwd.pm # once (36µs+2µs) by IO::Uncompress::Base::BEGIN@23 at line 23 of IO/Uncompress/Base.pm # once (33µs+2µs) by OpenBSD::PkgInfo::BEGIN@179 at line 179 of OpenBSD/PkgInfo.pm # once (30µs+0s) by main::BEGIN@22 at line 22 of OpenBSD/PkgInfo.pm # once (25µs+0s) by IO::Uncompress::Gunzip::BEGIN@12 at line 12 of IO/Uncompress/Gunzip.pm # once (25µs+0s) by IO::Uncompress::RawInflate::BEGIN@11 at line 11 of IO/Uncompress/RawInflate.pm # once (10µs+0s) by OpenBSD::MkTemp::BEGIN@7 at line 7 of OpenBSD/MkTemp.pm
sub import {
295075µs my $pkg = shift;
305066µs my $callpkg = caller($ExportLevel);
31
325052µs if ($pkg eq "Exporter" and @_ and $_[0] eq "import") {
3314µs *{$callpkg."::import"} = \&import;
3414µs return;
35 }
36
37 # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-(
3849169µ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.
4149122µs my $fail = ${$pkg . '::'}{EXPORT_FAIL} && \@{"$pkg\::EXPORT_FAIL"};
424962µs return export $pkg, $callpkg, @_
43 if $Verbose or $Debug or $fail && @$fail > 1;
444991µs my $export_cache = ($Cache{$pkg} ||= {});
4549136µs my $args = @_ or @_ = @$exports;
46
474944µs if ($args and not %$export_cache) {
48 s/^&//, $export_cache->{$_} = 1
4971.33ms284195µs foreach (@$exports, @{"$pkg\::EXPORT_OK"});
# spent 195µs making 284 calls to Exporter::CORE:subst, avg 687ns/call
50 }
514934µ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.
544974µ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
5725640µs140165µs foreach (@_);
# spent 165µs making 140 calls to Exporter::CORE:match, avg 1µs/call
58 } else {
59 ($heavy = /\W/) and last
60245.85ms215183µs foreach (@_);
# spent 183µs making 215 calls to Exporter::CORE:match, avg 850ns/call
61 }
6249111µs81.79ms return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy;
# spent 1.79ms making 8 calls to Exporter::export, avg 223µs/call
63 local $SIG{__WARN__} =
6441299µs sub {require Carp; &Carp::carp} if not $SIG{__WARN__};
65 # shortcut for the common case of no type character
66411.59ms *{"$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
80sub export_to_level {
81 goto &{as_heavy()};
82}
83
84sub export_tags {
85 goto &{as_heavy()};
86}
87
88
# spent 58µs (18+41) within Exporter::export_ok_tags which was called 2 times, avg 29µs/call: # once (10µs+20µs) by OpenBSD::PackageRepository::uncompress at line 27 of IO/Uncompress/Gunzip.pm # once (8µs+21µs) by IO::Uncompress::Gunzip::BEGIN@12 at line 25 of IO/Uncompress/RawInflate.pm
sub export_ok_tags {
89221µs486µs goto &{as_heavy()};
# spent 46µs making 2 calls to Exporter::Heavy::heavy_export_ok_tags, avg 23µs/call # spent 41µs making 2 calls to Exporter::as_heavy, avg 20µs/call
90}
91
92sub require_version {
93 goto &{as_heavy()};
94}
95
96112µs1;
97__END__
 
# spent 348µs within Exporter::CORE:match which was called 355 times, avg 981ns/call: # 215 times (183µs+0s) by Exporter::import at line 60, avg 850ns/call # 140 times (165µs+0s) by Exporter::import at line 57, avg 1µs/call
sub Exporter::CORE:match; # opcode
# spent 239µs within Exporter::CORE:subst which was called 294 times, avg 812ns/call: # 284 times (195µs+0s) by Exporter::import at line 49, avg 687ns/call # 10 times (44µs+0s) by Exporter::as_heavy at line 20, avg 4µs/call
sub Exporter::CORE:subst; # opcode