← Index
NYTProf Performance Profile   « line view »
For /home/ss5/perl5/perlbrew/perls/perl-5.22.0/bin/benchmarkanything-storage
  Run on Mon Jan 29 16:55:34 2018
Reported on Mon Jan 29 16:57:07 2018

Filename/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/B/Hooks/EndOfScope/XS.pm
StatementsExecuted 153 statements in 632µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111493µs757µsB::Hooks::EndOfScope::XS::::BEGIN@9B::Hooks::EndOfScope::XS::BEGIN@9
2011136µs264µsB::Hooks::EndOfScope::XS::::on_scope_endB::Hooks::EndOfScope::XS::on_scope_end
202020120µs3.91msB::Hooks::EndOfScope::XS::::__ANON__[:17]B::Hooks::EndOfScope::XS::__ANON__[:17]
201138µs38µsB::Hooks::EndOfScope::XS::::__ANON__[:16]B::Hooks::EndOfScope::XS::__ANON__[:16]
11115µs78µsB::Hooks::EndOfScope::XS::::BEGIN@10B::Hooks::EndOfScope::XS::BEGIN@10
1118µs9µsB::Hooks::EndOfScope::XS::::BEGIN@4B::Hooks::EndOfScope::XS::BEGIN@4
1114µs7µsB::Hooks::EndOfScope::XS::::BEGIN@5B::Hooks::EndOfScope::XS::BEGIN@5
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package B::Hooks::EndOfScope::XS;
2# ABSTRACT: Execute code after a scope finished compilation - XS implementation
3
4214µs211µs
# spent 9µs (8+1) within B::Hooks::EndOfScope::XS::BEGIN@4 which was called: # once (8µs+1µs) by Module::Runtime::require_module at line 4
use strict;
# spent 9µs making 1 call to B::Hooks::EndOfScope::XS::BEGIN@4 # spent 1µs making 1 call to strict::import
5224µs29µs
# spent 7µs (4+3) within B::Hooks::EndOfScope::XS::BEGIN@5 which was called: # once (4µs+3µs) by Module::Runtime::require_module at line 5
use warnings;
# spent 7µs making 1 call to B::Hooks::EndOfScope::XS::BEGIN@5 # spent 3µs making 1 call to warnings::import
6
71300nsour $VERSION = '0.15';
8
9374µs2763µs
# spent 757µs (493+264) within B::Hooks::EndOfScope::XS::BEGIN@9 which was called: # once (493µs+264µs) by Module::Runtime::require_module at line 9
use Variable::Magic 0.48 ();
# spent 757µs making 1 call to B::Hooks::EndOfScope::XS::BEGIN@9 # spent 6µs making 1 call to UNIVERSAL::VERSION
1016µs158µs
# spent 78µs (15+63) within B::Hooks::EndOfScope::XS::BEGIN@10 which was called: # once (15µs+63µs) by Module::Runtime::require_module at line 13
use Sub::Exporter::Progressive 0.001006 -setup => {
# spent 58µs making 1 call to Sub::Exporter::Progressive::import
11 exports => ['on_scope_end'],
12 groups => { default => ['on_scope_end'] },
132116µs283µs};
# spent 78µs making 1 call to B::Hooks::EndOfScope::XS::BEGIN@10 # spent 5µs making 1 call to UNIVERSAL::VERSION
14
15my $wiz = Variable::Magic::wizard
162044µs
# spent 38µs within B::Hooks::EndOfScope::XS::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/B/Hooks/EndOfScope/XS.pm:16] which was called 20 times, avg 2µs/call: # 20 times (38µs+0s) by Variable::Magic::cast at line 36, avg 2µs/call
data => sub { [$_[1]] },
1740122µs203.79ms
# spent 3.91ms (120µs+3.79) within B::Hooks::EndOfScope::XS::__ANON__[/home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/B/Hooks/EndOfScope/XS.pm:17] which was called 20 times, avg 195µs/call: # once (20µs+394µs) by Module::Runtime::require_module at line 63 of Search/Elasticsearch/Role/Transport.pm # once (6µs+278µs) by Module::Runtime::require_module at line 391 of Search/Elasticsearch/Role/Cxn.pm # once (6µs+258µs) by Module::Runtime::require_module at line 63 of Search/Elasticsearch/Transport.pm # once (7µs+248µs) by Module::Runtime::require_module at line 67 of Search/Elasticsearch/Role/CxnPool/Static.pm # once (4µs+242µs) by Module::Runtime::require_module at line 170 of Search/Elasticsearch/Role/Client/Direct.pm # once (4µs+240µs) by Module::Runtime::require_module at line 165 of Search/Elasticsearch/Role/Serializer/JSON.pm # once (7µs+224µs) by Module::Runtime::require_module at line 296 of Search/Elasticsearch/Role/CxnPool.pm # once (7µs+219µs) by Module::Runtime::require_module at line 192 of Search/Elasticsearch/CxnPool/Static.pm # once (5µs+194µs) by Module::Runtime::require_module at line 141 of Search/Elasticsearch/Role/Logger.pm # once (11µs+154µs) by Module::Runtime::require_module at line 76 of Search/Elasticsearch/Cxn/HTTPTiny.pm # once (4µs+155µs) by Module::Runtime::require_module at line 51 of Search/Elasticsearch/Role/API.pm # once (6µs+153µs) by Module::Runtime::require_module at line 1659 of Search/Elasticsearch/Client/5_0/Direct.pm # once (4µs+153µs) by Module::Runtime::require_module at line 75 of Search/Elasticsearch/Cxn/Factory.pm # once (4µs+148µs) by Module::Runtime::require_module at line 2350 of Search/Elasticsearch/Client/5_0/Role/API.pm # once (3µs+148µs) by Module::Runtime::require_module at line 10 of Search/Elasticsearch/Role/Is_Sync.pm # once (4µs+145µs) by Module::Runtime::require_module at line 48 of Search/Elasticsearch/Logger/LogAny.pm # once (6µs+126µs) by Module::Runtime::require_module at line 15 of Search/Elasticsearch/Serializer/JSON.pm # once (4µs+125µs) by Module::Runtime::require_module at line 61 of Search/Elasticsearch/Role/Client.pm # once (3µs+116µs) by Module::Runtime::require_module at line 20 of BenchmarkAnything/Storage/Search/Elasticsearch/Serializer/JSON/DontTouchMyUTF8.pm # once (5µs+68µs) by BenchmarkAnything::Storage::Search::Elasticsearch::get_elasticsearch_client at line 578 of Search/Elasticsearch.pm
free => sub { $_->() for @{ $_[1] }; () },
# spent 3.79ms making 20 calls to namespace::clean::__ANON__[namespace/clean.pm:178], avg 189µs/call
18 # When someone localise %^H, our magic doesn't want to be copied
19 # down. We want it to be around only for the scope we've initially
20 # attached ourselfs to. Merely having MGf_LOCAL and a noop svt_local
21 # callback achieves this. If anything wants to attach more magic of our
22 # kind to a localised %^H, things will continue to just work as we'll be
23 # attached with a new and empty callback list.
2414µs120µs local => \undef
# spent 20µs making 1 call to Variable::Magic::wizard
25;
26
27
# spent 264µs (136+129) within B::Hooks::EndOfScope::XS::on_scope_end which was called 20 times, avg 13µs/call: # 20 times (136µs+129µs) by namespace::clean::import at line 178 of namespace/clean.pm, avg 13µs/call
sub on_scope_end (&) {
28207µs my $cb = shift;
29
302020µs $^H |= 0x020000;
31
322092µs2016µs if (my $stack = Variable::Magic::getdata %^H, $wiz) {
# spent 16µs making 20 calls to Variable::Magic::getdata, avg 815ns/call
33 push @{ $stack }, $cb;
34 }
35 else {
3620108µs40150µs Variable::Magic::cast %^H, $wiz, $cb;
# spent 113µs making 20 calls to Variable::Magic::cast, avg 6µs/call # spent 38µs making 20 calls to B::Hooks::EndOfScope::XS::__ANON__[B/Hooks/EndOfScope/XS.pm:16], avg 2µs/call
37 }
38}
39
40
41#pod =head1 DESCRIPTION
42#pod
43#pod This is the implementation of L<B::Hooks::EndOfScope> based on
44#pod L<Variable::Magic>, which is an XS module dependent on a compiler. It will
45#pod always be automatically preferred if L<Variable::Magic> is available.
46#pod
47#pod =func on_scope_end
48#pod
49#pod on_scope_end { ... };
50#pod
51#pod on_scope_end $code;
52#pod
53#pod Registers C<$code> to be executed after the surrounding scope has been
54#pod compiled.
55#pod
56#pod This is exported by default. See L<Sub::Exporter> on how to customize it.
57#pod
58#pod =cut
59
6013µs1;
61
62__END__