← Index
NYTProf Performance Profile   « line view »
For /usr/sbin/pkg_info
  Run on Mon Aug 7 09:39:31 2017
Reported on Mon Aug 7 09:40:21 2017

Filename/usr/libdata/perl5/Exporter.pm
StatementsExecuted 787 statements in 7.78ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
102133.1ms33.3msExporter::::as_heavyExporter::as_heavy
5050266.25ms41.6msExporter::::importExporter::import
35521378µs378µsExporter::::CORE:matchExporter::CORE:match (opcode)
29421277µs277µsExporter::::CORE:substExporter::CORE:subst (opcode)
81169µs33.3msExporter::::exportExporter::export
22214µs46µ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
3129µ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.72';
13our (%Cache);
14
15
# spent 33.3ms (33.1+185µs) within Exporter::as_heavy which was called 10 times, avg 3.33ms/call: # 8 times (33.1ms+178µs) by Exporter::export at line 25, avg 4.15ms/call # 2 times (25µs+7µs) by Exporter::export_ok_tags at line 89, avg 16µs/call
sub as_heavy {
1610436µ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
191051µs my $c = (caller(1))[3];
201091µs1052µs $c =~ s/.*:://;
# spent 52µs making 10 calls to Exporter::CORE:subst, avg 5µs/call
211072µs \&{"Exporter::Heavy::heavy_$c"};
22}
23
24
# spent 33.3ms (69µs+33.2) within Exporter::export which was called 8 times, avg 4.16ms/call: # 8 times (69µs+33.2ms) by Exporter::import at line 62, avg 4.16ms/call
sub export {
258572µs1634.7ms goto &{as_heavy()};
# spent 33.2ms making 8 calls to Exporter::as_heavy, avg 4.15ms/call # spent 1.45ms making 8 calls to Exporter::Heavy::heavy_export, avg 181µs/call
26}
27
28
# spent 41.6ms (6.25+35.4) within Exporter::import which was called 50 times, avg 832µs/call: # once (1.04ms+33.5ms) by OpenBSD::PackageInfo::BEGIN@39 at line 39 of OpenBSD/PackageInfo.pm # once (701µs+31µs) by Compress::Raw::Zlib::BEGIN@6 at line 6 of Compress/Raw/Zlib.pm # once (146µs+559µs) by File::Glob::import at line 46 of File/Glob.pm # once (424µs+38µs) by IO::Uncompress::RawInflate::BEGIN@8 at line 8 of IO/Uncompress/RawInflate.pm # once (315µs+10µs) by OpenBSD::State::BEGIN@86 at line 86 of OpenBSD/State.pm # once (71µs+233µs) by IO::Uncompress::Gunzip::BEGIN@16 at line 16 of IO/Uncompress/Gunzip.pm # once (69µs+211µs) by IO::Compress::Zlib::Extra::BEGIN@13 at line 13 of IO/Compress/Zlib/Extra.pm # once (104µs+158µs) by IO::Uncompress::RawInflate::BEGIN@9 at line 9 of IO/Uncompress/RawInflate.pm # once (204µs+14µs) by OpenBSD::State::BEGIN@88 at line 88 of OpenBSD/State.pm # once (185µs+20µs) by OpenBSD::PkgInfo::BEGIN@177 at line 177 of OpenBSD/PkgInfo.pm # once (181µs+24µs) by OpenBSD::PkgInfo::State::BEGIN@65 at line 65 of OpenBSD/PkgInfo.pm # once (176µs+19µs) by IO::Uncompress::Base::BEGIN@19 at line 147 of IO/File.pm # once (153µs+31µs) by IO::Uncompress::Adapter::Inflate::BEGIN@8 at line 8 of IO/Uncompress/Adapter/Inflate.pm # once (163µs+21µs) by IO::Uncompress::Base::BEGIN@19 at line 19 of IO/Uncompress/Base.pm # once (163µs+19µs) by IO::Uncompress::Base::BEGIN@17 at line 17 of IO/Uncompress/Base.pm # once (157µs+22µs) by OpenBSD::PackageRepository::Installed::BEGIN@197 at line 198 of OpenBSD/PackageRepository/Installed.pm # once (50µs+127µs) by OpenBSD::Getopt::getopts at line 85 of OpenBSD/Getopt.pm # once (162µs+14µs) by OpenBSD::PackageLocation::BEGIN@23 at line 23 of OpenBSD/PackageLocation.pm # once (160µs+8µs) by OpenBSD::Error::BEGIN@72 at line 72 of OpenBSD/Error.pm # once (146µs+21µs) by IO::Compress::Base::Common::BEGIN@8 at line 8 of IO/Compress/Base/Common.pm # once (27µs+135µs) by IO::Uncompress::Adapter::Inflate::BEGIN@7 at line 7 of IO/Uncompress/Adapter/Inflate.pm # once (22µs+101µs) by IO::Uncompress::Gunzip::BEGIN@15 at line 15 of IO/Uncompress/Gunzip.pm # once (85µs+7µs) by OpenBSD::PackageLocation::BEGIN@25 at line 25 of OpenBSD/PackageLocation.pm # once (78µs+8µs) by OpenBSD::PackageRepository::Local::BEGIN@454 at line 454 of OpenBSD/PackageRepository.pm # once (74µs+6µs) by OpenBSD::PkgInfo::BEGIN@180 at line 180 of OpenBSD/PkgInfo.pm # once (65µs+8µs) by File::Path::BEGIN@6 at line 6 of File/Path.pm # once (66µs+4µs) by IO::Compress::Base::Common::BEGIN@7 at line 7 of IO/Compress/Base/Common.pm # once (63µs+5µs) by OpenBSD::PackageRepository::BEGIN@32 at line 32 of OpenBSD/PackageRepository.pm # once (63µs+5µs) by OpenBSD::Temp::BEGIN@25 at line 25 of OpenBSD/Temp.pm # once (64µs+4µs) by File::GlobMapper::BEGIN@5 at line 5 of File/GlobMapper.pm # once (66µs+0s) by main::BEGIN@22 at line 22 of OpenBSD/PkgInfo.pm # once (57µs+3µs) by OpenBSD::Temp::BEGIN@23 at line 23 of OpenBSD/Temp.pm # once (56µs+2µs) by OpenBSD::PkgInfo::BEGIN@179 at line 179 of OpenBSD/PkgInfo.pm # once (54µs+3µs) by IO::BEGIN@6 at line 6 of IO.pm # once (53µs+3µs) by IO::Compress::Base::Common::BEGIN@523 at line 523 of IO/Compress/Base/Common.pm # once (49µs+3µs) by IO::Seekable::BEGIN@104 at line 104 of IO/Seekable.pm # once (48µs+4µs) by IO::File::BEGIN@131 at line 131 of IO/File.pm # once (49µs+3µs) by IO::File::BEGIN@130 at line 130 of IO/File.pm # once (43µs+3µs) by IO::Uncompress::Base::BEGIN@20 at line 20 of IO/Uncompress/Base.pm # once (43µs+3µs) by IO::Seekable::BEGIN@98 at line 98 of IO/Seekable.pm # once (42µs+3µs) by IO::Handle::BEGIN@267 at line 267 of IO/Handle.pm # once (42µs+3µs) by IO::Handle::BEGIN@266 at line 266 of IO/Handle.pm # once (41µs+2µs) by SelectSaver::BEGIN@38 at line 38 of SelectSaver.pm # once (40µs+3µs) by SelectSaver::BEGIN@39 at line 39 of SelectSaver.pm # once (40µs+3µs) by IO::File::BEGIN@133 at line 133 of IO/File.pm # once (41µ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 (30µs+0s) by IO::Uncompress::RawInflate::BEGIN@11 at line 11 of IO/Uncompress/RawInflate.pm # once (25µs+0s) by IO::Uncompress::Gunzip::BEGIN@12 at line 12 of IO/Uncompress/Gunzip.pm # once (18µs+0s) by OpenBSD::MkTemp::BEGIN@7 at line 7 of OpenBSD/MkTemp.pm
sub import {
295070µs my $pkg = shift;
305087µs my $callpkg = caller($ExportLevel);
31
325065µs if ($pkg eq "Exporter" and @_ and $_[0] eq "import") {
3319µs *{$callpkg."::import"} = \&import;
3416µs return;
35 }
36
37 # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-(
3849218µ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.
4149147µs my $fail = ${$pkg . '::'}{EXPORT_FAIL} && \@{"$pkg\::EXPORT_FAIL"};
424971µs return export $pkg, $callpkg, @_
43 if $Verbose or $Debug or $fail && @$fail > 1;
4449112µs my $export_cache = ($Cache{$pkg} ||= {});
4549198µs my $args = @_ or @_ = @$exports;
46
474949µs if ($args and not %$export_cache) {
48 s/^&//, $export_cache->{$_} = 1
4971.17ms284225µs foreach (@$exports, @{"$pkg\::EXPORT_OK"});
# spent 225µs making 284 calls to Exporter::CORE:subst, avg 793ns/call
50 }
514938µ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.
544982µ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
5725665µs140170µs foreach (@_);
# spent 170µs making 140 calls to Exporter::CORE:match, avg 1µs/call
58 } else {
59 ($heavy = /\W/) and last
6024894µs215208µs foreach (@_);
# spent 208µs making 215 calls to Exporter::CORE:match, avg 966ns/call
61 }
6249112µs833.3ms return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy;
# spent 33.3ms making 8 calls to Exporter::export, avg 4.16ms/call
63 local $SIG{__WARN__} =
6441772µs sub {require Carp; &Carp::carp} if not $SIG{__WARN__};
65 # shortcut for the common case of no type character
66411.72ms *{"$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 46µs (14+32) within Exporter::export_ok_tags which was called 2 times, avg 23µs/call: # once (8µs+16µs) by IO::Uncompress::Gunzip::BEGIN@12 at line 25 of IO/Uncompress/RawInflate.pm # once (6µs+16µs) by OpenBSD::PackageRepository::uncompress at line 27 of IO/Uncompress/Gunzip.pm
sub export_ok_tags {
89217µs472µs goto &{as_heavy()};
# spent 40µs making 2 calls to Exporter::Heavy::heavy_export_ok_tags, avg 20µs/call # spent 32µs making 2 calls to Exporter::as_heavy, avg 16µs/call
90}
91
92sub require_version {
93 goto &{as_heavy()};
94}
95
96119µs1;
97__END__
 
# spent 378µs within Exporter::CORE:match which was called 355 times, avg 1µs/call: # 215 times (208µs+0s) by Exporter::import at line 60, avg 966ns/call # 140 times (170µs+0s) by Exporter::import at line 57, avg 1µs/call
sub Exporter::CORE:match; # opcode
# spent 277µs within Exporter::CORE:subst which was called 294 times, avg 942ns/call: # 284 times (225µs+0s) by Exporter::import at line 49, avg 793ns/call # 10 times (52µs+0s) by Exporter::as_heavy at line 20, avg 5µs/call
sub Exporter::CORE:subst; # opcode