Filename | /home/ss5/perl5/perlbrew/perls/perl-5.22.0/lib/site_perl/5.22.0/B/Hooks/EndOfScope/XS.pm |
Statements | Executed 153 statements in 632µs |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
1 | 1 | 1 | 493µs | 757µs | BEGIN@9 | B::Hooks::EndOfScope::XS::
20 | 1 | 1 | 136µs | 264µs | on_scope_end | B::Hooks::EndOfScope::XS::
20 | 20 | 20 | 120µs | 3.91ms | __ANON__[:17] | B::Hooks::EndOfScope::XS::
20 | 1 | 1 | 38µs | 38µs | __ANON__[:16] | B::Hooks::EndOfScope::XS::
1 | 1 | 1 | 15µs | 78µs | BEGIN@10 | B::Hooks::EndOfScope::XS::
1 | 1 | 1 | 8µs | 9µs | BEGIN@4 | B::Hooks::EndOfScope::XS::
1 | 1 | 1 | 4µs | 7µs | BEGIN@5 | B::Hooks::EndOfScope::XS::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package B::Hooks::EndOfScope::XS; | ||||
2 | # ABSTRACT: Execute code after a scope finished compilation - XS implementation | ||||
3 | |||||
4 | 2 | 14µs | 2 | 11µ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 # spent 9µs making 1 call to B::Hooks::EndOfScope::XS::BEGIN@4
# spent 1µs making 1 call to strict::import |
5 | 2 | 24µs | 2 | 9µ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 # spent 7µs making 1 call to B::Hooks::EndOfScope::XS::BEGIN@5
# spent 3µs making 1 call to warnings::import |
6 | |||||
7 | 1 | 300ns | our $VERSION = '0.15'; | ||
8 | |||||
9 | 3 | 74µs | 2 | 763µ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 # spent 757µs making 1 call to B::Hooks::EndOfScope::XS::BEGIN@9
# spent 6µs making 1 call to UNIVERSAL::VERSION |
10 | 1 | 6µs | 1 | 58µ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 # spent 58µs making 1 call to Sub::Exporter::Progressive::import |
11 | exports => ['on_scope_end'], | ||||
12 | groups => { default => ['on_scope_end'] }, | ||||
13 | 2 | 116µs | 2 | 83µs | }; # spent 78µs making 1 call to B::Hooks::EndOfScope::XS::BEGIN@10
# spent 5µs making 1 call to UNIVERSAL::VERSION |
14 | |||||
15 | my $wiz = Variable::Magic::wizard | ||||
16 | 20 | 44µ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 | ||
17 | 40 | 122µs | 20 | 3.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 # 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. | ||||
24 | 1 | 4µs | 1 | 20µ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 | ||||
28 | 20 | 7µs | my $cb = shift; | ||
29 | |||||
30 | 20 | 20µs | $^H |= 0x020000; | ||
31 | |||||
32 | 20 | 92µs | 20 | 16µ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 { | ||||
36 | 20 | 108µs | 40 | 150µ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 | |||||
60 | 1 | 3µs | 1; | ||
61 | |||||
62 | __END__ |