← Index
NYTProf Performance Profile   « line view »
For flows_to_es.pl
  Run on Mon May 9 23:27:59 2016
Reported on Mon May 9 23:28:08 2016

Filename/usr/share/perl/5.18/Exporter.pm
StatementsExecuted 1404 statements in 12.3ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
90885311.0ms14.3msExporter::::importExporter::import
12211.75ms1.86msExporter::::as_heavyExporter::as_heavy
139121436µs436µsExporter::::CORE:substExporter::CORE:subst (opcode)
100321295µs295µsExporter::::CORE:matchExporter::CORE:match (opcode)
93338µs1.86msExporter::::exportExporter::export
31115µs52µsExporter::::export_to_levelExporter::export_to_level
0000s0sExporter::::__ANON__[:64]Exporter::__ANON__[:64]
0000s0sExporter::::export_failExporter::export_fail
0000s0sExporter::::export_ok_tagsExporter::export_ok_tags
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
319µsrequire 5.006;
4
5# Be lean.
6#use strict;
7#no strict 'refs';
8
91300nsour $Debug = 0;
101100nsour $ExportLevel = 0;
111200nsour $Verbose ||= 0;
121300nsour $VERSION = '5.68';
131300nsour (%Cache);
14
15
# spent 1.86ms (1.75+114µs) within Exporter::as_heavy which was called 12 times, avg 155µs/call: # 9 times (1.72ms+104µs) by Exporter::export at line 25, avg 203µs/call # 3 times (27µs+10µs) by Exporter::export_to_level at line 81, avg 12µs/call
sub as_heavy {
161290µ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
191227µs my $c = (caller(1))[3];
201272µs1236µs $c =~ s/.*:://;
# spent 36µs making 12 calls to Exporter::CORE:subst, avg 3µs/call
211247µs \&{"Exporter::Heavy::heavy_$c"};
22}
23
24
# spent 1.86ms (38µs+1.83) within Exporter::export which was called 9 times, avg 207µs/call: # 4 times (20µs+1.78ms) by IO::Socket::import at line 36 of IO/Socket.pm, avg 451µs/call # 3 times (10µs+21µs) by Exporter::Heavy::heavy_export_to_level at line 200 of Exporter/Heavy.pm, avg 10µs/call # 2 times (8µs+21µs) by Exporter::import at line 62, avg 15µs/call
sub export {
25948µs187.37ms goto &{as_heavy()};
# spent 5.55ms making 9 calls to Exporter::Heavy::heavy_export, avg 616µs/call # spent 1.83ms making 9 calls to Exporter::as_heavy, avg 203µs/call
26}
27
28
# spent 14.3ms (11.0+3.31) within Exporter::import which was called 90 times, avg 159µs/call: # 3 times (1.67ms+2.80ms) by POSIX::import at line 30 of POSIX.pm, avg 1.49ms/call # once (3.73ms+5µs) by main::BEGIN@123 at line 123 of flows_to_es.pl # once (836µs+39µs) by IO::Socket::INET::BEGIN@12 at line 12 of IO/Socket/INET.pm # once (577µs+100µs) by Moo::BEGIN@5 at line 5 of Moo.pm # once (601µs+36µs) by IO::Socket::BEGIN@12 at line 12 of IO/Socket.pm # once (381µs+29µs) by POSIX::BEGIN@11 at line 11 of POSIX.pm # once (262µs+50µs) by HTTP::Tiny::Handle::BEGIN@981 at line 981 of /opt/flows/lib/lib/perl5/HTTP/Tiny.pm # once (18µs+99µs) by Storable::BEGIN@52 at line 53 of Storable.pm # once (101µs+7µs) by Search::Elasticsearch::Role::Serializer::JSON::BEGIN@8 at line 8 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Serializer/JSON.pm # once (92µs+9µs) by Log::Any::BEGIN@11 at line 11 of /opt/flows/lib/lib/perl5/Log/Any.pm # once (72µs+5µs) by JSON::MaybeXS::BEGIN@29 at line 31 of /opt/flows/lib/lib/perl5/JSON/MaybeXS.pm # once (73µs+4µs) by Method::Generate::Accessor::BEGIN@4 at line 4 of Method/Generate/Accessor.pm # once (67µs+4µs) by Moo::Role::BEGIN@4 at line 4 of Moo/Role.pm # once (63µs+4µs) by Method::Generate::BuildAll::BEGIN@6 at line 6 of Method/Generate/BuildAll.pm # once (62µs+4µs) by Sub::Defer::BEGIN@5 at line 5 of Sub/Defer.pm # once (61µs+3µs) by Moo::BEGIN@4 at line 4 of Moo.pm # once (58µs+4µs) by Method::Generate::Constructor::BEGIN@8 at line 8 of Method/Generate/Constructor.pm # once (54µs+4µs) by main::BEGIN@8 at line 8 of flows_to_es.pl # once (52µs+3µs) by Sub::Defer::BEGIN@6 at line 6 of Sub/Defer.pm # once (53µs+2µs) by IO::Handle::BEGIN@6 at line 6 of IO/Handle.pm # once (48µs+3µs) by File::Path::BEGIN@6 at line 6 of File/Path.pm # once (47µs+3µs) by Search::Elasticsearch::Role::Cxn::BEGIN@5 at line 5 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Cxn.pm # once (44µs+2µs) by Sub::Quote::BEGIN@7 at line 7 of Sub/Quote.pm # once (43µs+3µs) by InfluxDB::LineProtocol::BEGIN@9 at line 9 of /opt/flows/lib/lib/perl5/InfluxDB/LineProtocol.pm # once (42µs+2µs) by IO::Handle::BEGIN@7 at line 7 of IO/Handle.pm # once (40µs+2µs) by Search::Elasticsearch::Util::API::Path::BEGIN@5 at line 5 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Util/API/Path.pm # once (40µs+2µs) by Search::Elasticsearch::Role::Serializer::JSON::BEGIN@7 at line 7 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Serializer/JSON.pm # once (40µs+2µs) by Search::Elasticsearch::Role::Transport::BEGIN@7 at line 7 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Transport.pm # once (40µs+2µs) by SelectSaver::BEGIN@6 at line 6 of SelectSaver.pm # once (39µs+2µs) by Class::XSAccessor::Heavy::BEGIN@7 at line 7 of Class/XSAccessor/Heavy.pm # once (39µs+2µs) by main::BEGIN@10 at line 10 of flows_to_es.pl # once (38µs+2µs) by URI::_idna::BEGIN@7 at line 7 of URI/_idna.pm # once (39µs+2µs) by Search::Elasticsearch::Transport::BEGIN@7 at line 7 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Transport.pm # once (38µs+3µs) by main::BEGIN@124 at line 124 of flows_to_es.pl # once (38µs+2µs) by Tie::Hash::BEGIN@5 at line 5 of Tie/Hash.pm # once (38µs+2µs) by namespace::clean::BEGIN@38 at line 38 of /opt/flows/lib/lib/perl5/namespace/clean.pm # once (37µs+2µs) by Try::Tiny::BEGIN@15 at line 15 of Try/Tiny.pm # once (37µs+2µs) by Data::Dumper::BEGIN@22 at line 22 of Data/Dumper.pm # once (36µs+3µs) by URI::_server::BEGIN@6 at line 6 of URI/_server.pm # once (37µs+2µs) by Sub::Install::BEGIN@6 at line 6 of /opt/flows/lib/lib/perl5/Sub/Install.pm # once (37µs+2µs) by Search::Elasticsearch::Role::Logger::BEGIN@6 at line 6 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Logger.pm # once (36µs+2µs) by Method::Generate::Constructor::BEGIN@4 at line 4 of Method/Generate/Constructor.pm # once (36µs+2µs) by Search::Elasticsearch::Bulk::BEGIN@7 at line 7 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Bulk.pm # once (36µs+2µs) by Log::Any::Adapter::Base::BEGIN@10 at line 10 of /opt/flows/lib/lib/perl5/Log/Any/Adapter/Base.pm # once (36µs+2µs) by Socket::BEGIN@10 at line 10 of Socket.pm # once (36µs+2µs) by IO::Socket::UNIX::BEGIN@12 at line 12 of IO/Socket/UNIX.pm # once (35µs+2µs) by Method::Generate::BuildAll::BEGIN@5 at line 5 of Method/Generate/BuildAll.pm # once (36µs+2µs) by IO::BEGIN@6 at line 6 of IO.pm # once (35µs+2µs) by main::BEGIN@125 at line 125 of flows_to_es.pl # once (34µs+2µs) by Search::Elasticsearch::Role::Client::Direct::BEGIN@6 at line 6 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Client/Direct.pm # once (35µs+2µs) by main::BEGIN@11 at line 11 of flows_to_es.pl # once (34µs+2µs) by Method::Generate::Constructor::BEGIN@6 at line 6 of Method/Generate/Constructor.pm # once (34µs+2µs) by IO::Socket::INET::BEGIN@13 at line 13 of IO/Socket/INET.pm # once (34µs+2µs) by Method::Generate::Accessor::BEGIN@6 at line 6 of Method/Generate/Accessor.pm # once (34µs+2µs) by IO::Socket::BEGIN@13 at line 13 of IO/Socket.pm # once (33µs+2µs) by SelectSaver::BEGIN@7 at line 7 of SelectSaver.pm # once (33µs+2µs) by Module::Implementation::BEGIN@13 at line 13 of Module/Implementation.pm # once (33µs+2µs) by Search::Elasticsearch::Role::Cxn::BEGIN@6 at line 6 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/Cxn.pm # once (31µs+2µs) by Encode::BEGIN@47 at line 47 of Encode.pm # once (31µs+1µs) by namespace::clean::BEGIN@11 at line 38 of Sub/Exporter/Progressive.pm # once (30µs+2µs) by main::BEGIN@381 at line 381 of flows_to_es.pl # once (30µs+1µs) by Class::XSAccessor::BEGIN@5 at line 5 of Class/XSAccessor.pm # once (29µs+1µs) by Sub::Quote::BEGIN@8 at line 8 of Sub/Quote.pm # once (28µs+1µs) by HTTP::Tiny::Handle::BEGIN@983 at line 983 of /opt/flows/lib/lib/perl5/HTTP/Tiny.pm # once (28µs+1µs) by Data::OptList::BEGIN@7 at line 95 of /opt/flows/lib/lib/perl5/x86_64-linux-gnu-thread-multi/Params/Util.pm # once (28µs+1µs) by Search::Elasticsearch::Util::BEGIN@5 at line 5 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Util.pm # once (28µs+1µs) by main::BEGIN@9 at line 9 of flows_to_es.pl # once (27µs+1µs) by Sub::Quote::BEGIN@9 at line 9 of Sub/Quote.pm # once (26µs+1µs) by URI::_generic::BEGIN@7 at line 7 of URI/_generic.pm # once (26µs+1µs) by URI::_idna::BEGIN@8 at line 8 of URI/_idna.pm # once (26µs+1µs) by URI::_query::BEGIN@5 at line 5 of URI/_query.pm # once (26µs+1µs) by Method::Generate::Accessor::BEGIN@8 at line 8 of Method/Generate/Accessor.pm # once (25µs+1µs) by Search::Elasticsearch::Role::CxnPool::BEGIN@5 at line 5 of /opt/flows/lib/lib/perl5/Search/Elasticsearch/Role/CxnPool.pm # once (24µs+1µs) by Try::Tiny::BEGIN@1 at line 1 of (eval 7)[Try/Tiny.pm:18] # once (23µs+1µs) by Method::Generate::BuildAll::BEGIN@7 at line 7 of Method/Generate/BuildAll.pm # once (23µs+1µs) by Method::Generate::Constructor::BEGIN@7 at line 7 of Method/Generate/Constructor.pm # once (22µs+900ns) by Method::Generate::Accessor::BEGIN@7 at line 7 of Method/Generate/Accessor.pm # once (21µs+0s) by Cwd::BEGIN@4 at line 4 of Cwd.pm # once (21µs+0s) by IO::Socket::BEGIN@11 at line 11 of IO/Socket.pm # once (20µs+0s) by IO::Socket::BEGIN@17 at line 17 of IO/Socket.pm # once (18µs+0s) by Log::Any::Adapter::Util::BEGIN@10 at line 10 of /opt/flows/lib/lib/perl5/Log/Any/Adapter/Util.pm # once (18µs+0s) by JSON::XS::BEGIN@121 at line 121 of JSON/XS.pm # once (17µs+0s) by IO::Socket::INET::BEGIN@15 at line 15 of IO/Socket/INET.pm # once (15µs+0s) by IO::Socket::BEGIN@16 at line 16 of IO/Socket.pm # once (14µs+0s) by IO::Socket::INET::BEGIN@14 at line 14 of IO/Socket/INET.pm # once (9µs+0s) by Encode::BEGIN@12 at line 12 of Encode.pm # once (7µs+0s) by Try::Tiny::BEGIN@12 at line 12 of Try/Tiny.pm # once (6µs+0s) by Encode::Alias::BEGIN@8 at line 8 of Encode/Alias.pm
sub import {
299045µs my $pkg = shift;
309060µs my $callpkg = caller($ExportLevel);
31
329036µs if ($pkg eq "Exporter" and @_ and $_[0] eq "import") {
33311µs *{$callpkg."::import"} = \&import;
34321µs return;
35 }
36
37 # We *need* to treat @{"$pkg\::EXPORT_FAIL"} since Carp uses it :-(
3887164µ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.
418799µs my $fail = ${$pkg . '::'}{EXPORT_FAIL} && \@{"$pkg\::EXPORT_FAIL"};
428736µs return export $pkg, $callpkg, @_
43 if $Verbose or $Debug or $fail && @$fail > 1;
448773µs my $export_cache = ($Cache{$pkg} ||= {});
4587183µs my $args = @_ or @_ = @$exports;
46
478733µs if ($args and not %$export_cache) {
48 s/^&//, $export_cache->{$_} = 1
49216.50ms1379400µs foreach (@$exports, @{"$pkg\::EXPORT_OK"});
# spent 400µs making 1379 calls to Exporter::CORE:subst, avg 290ns/call
50 }
518710µ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.
548750µ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
5751747µs300116µs foreach (@_);
# spent 116µs making 300 calls to Exporter::CORE:match, avg 387ns/call
58 } else {
59 ($heavy = /\W/) and last
60361.21ms703179µs foreach (@_);
# spent 179µs making 703 calls to Exporter::CORE:match, avg 254ns/call
61 }
628745µs229µs return export $pkg, $callpkg, ($args ? @_ : ()) if $heavy;
# spent 29µs making 2 calls to Exporter::export, avg 15µs/call
63 local $SIG{__WARN__} =
6485408µs sub {require Carp; &Carp::carp} if not $SIG{__WARN__};
65 # shortcut for the common case of no type character
66852.23ms *{"$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 52µs (15+37) within Exporter::export_to_level which was called 3 times, avg 17µs/call: # 3 times (15µs+37µs) by Time::HiRes::import at line 63 of Time/HiRes.pm, avg 17µs/call
sub export_to_level {
81319µs6312µs goto &{as_heavy()};
# spent 275µs making 3 calls to Exporter::Heavy::heavy_export_to_level, avg 92µs/call # spent 37µs making 3 calls to Exporter::as_heavy, avg 12µs/call
82}
83
84sub export_tags {
85 goto &{as_heavy()};
86}
87
88sub export_ok_tags {
89 goto &{as_heavy()};
90}
91
92sub require_version {
93 goto &{as_heavy()};
94}
95
9614µs1;
97__END__
 
# spent 295µs within Exporter::CORE:match which was called 1003 times, avg 294ns/call: # 703 times (179µs+0s) by Exporter::import at line 60, avg 254ns/call # 300 times (116µs+0s) by Exporter::import at line 57, avg 387ns/call
sub Exporter::CORE:match; # opcode
# spent 436µs within Exporter::CORE:subst which was called 1391 times, avg 313ns/call: # 1379 times (400µs+0s) by Exporter::import at line 49, avg 290ns/call # 12 times (36µs+0s) by Exporter::as_heavy at line 20, avg 3µs/call
sub Exporter::CORE:subst; # opcode