← Index
NYTProf Performance Profile   « line view »
For index.cgi
  Run on Sat May 9 17:18:47 2020
Reported on Sat May 9 17:19:07 2020

Filename/usr/local/share/perl/5.18.2/B/Hooks/EndOfScope/XS.pm
StatementsExecuted 27 statements in 617µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1111.11ms2.72msB::Hooks::EndOfScope::XS::::BEGIN@9B::Hooks::EndOfScope::XS::BEGIN@9
22231µs63µsB::Hooks::EndOfScope::XS::::on_scope_endB::Hooks::EndOfScope::XS::on_scope_end
11122µs125µsB::Hooks::EndOfScope::XS::::BEGIN@10B::Hooks::EndOfScope::XS::BEGIN@10
22222µs2.55msB::Hooks::EndOfScope::XS::::__ANON__[:17]B::Hooks::EndOfScope::XS::__ANON__[:17]
11114µs32µsB::Hooks::EndOfScope::XS::::BEGIN@4B::Hooks::EndOfScope::XS::BEGIN@4
11110µs16µsB::Hooks::EndOfScope::XS::::BEGIN@5B::Hooks::EndOfScope::XS::BEGIN@5
2114µs4µsB::Hooks::EndOfScope::XS::::__ANON__[:16]B::Hooks::EndOfScope::XS::__ANON__[:16]
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
4231µs249µs
# spent 32µs (14+18) within B::Hooks::EndOfScope::XS::BEGIN@4 which was called: # once (14µs+18µs) by Module::Runtime::require_module at line 4
use strict;
# spent 32µs making 1 call to B::Hooks::EndOfScope::XS::BEGIN@4 # spent 18µs making 1 call to strict::import
52107µs222µs
# spent 16µs (10+6) within B::Hooks::EndOfScope::XS::BEGIN@5 which was called: # once (10µs+6µs) by Module::Runtime::require_module at line 5
use warnings;
# spent 16µs making 1 call to B::Hooks::EndOfScope::XS::BEGIN@5 # spent 6µs making 1 call to warnings::import
6
71900nsour $VERSION = '0.15';
8
93159µs22.73ms
# spent 2.72ms (1.11+1.61) within B::Hooks::EndOfScope::XS::BEGIN@9 which was called: # once (1.11ms+1.61ms) by Module::Runtime::require_module at line 9
use Variable::Magic 0.48 ();
# spent 2.72ms making 1 call to B::Hooks::EndOfScope::XS::BEGIN@9 # spent 13µs making 1 call to UNIVERSAL::VERSION
1018µs192µs
# spent 125µs (22+103) within B::Hooks::EndOfScope::XS::BEGIN@10 which was called: # once (22µs+103µs) by Module::Runtime::require_module at line 13
use Sub::Exporter::Progressive 0.001006 -setup => {
# spent 92µs making 1 call to Sub::Exporter::Progressive::import
11 exports => ['on_scope_end'],
12 groups => { default => ['on_scope_end'] },
132213µs2136µs};
# spent 125µs making 1 call to B::Hooks::EndOfScope::XS::BEGIN@10 # spent 11µs making 1 call to UNIVERSAL::VERSION
14
15my $wiz = Variable::Magic::wizard
1629µs
# spent 4µs within B::Hooks::EndOfScope::XS::__ANON__[/usr/local/share/perl/5.18.2/B/Hooks/EndOfScope/XS.pm:16] which was called 2 times, avg 2µs/call: # 2 times (4µs+0s) by Variable::Magic::cast at line 36, avg 2µs/call
data => sub { [$_[1]] },
17419µs22.52ms
# spent 2.55ms (22µs+2.52) within B::Hooks::EndOfScope::XS::__ANON__[/usr/local/share/perl/5.18.2/B/Hooks/EndOfScope/XS.pm:17] which was called 2 times, avg 1.27ms/call: # once (12µs+2.38ms) by main::BEGIN@7 at line 198 of String/Markov.pm # once (10µs+146µs) by String::Markov::BEGIN@9 at line 216 of namespace/autoclean.pm
free => sub { $_->() for @{ $_[1] }; () },
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.
2417µs147µs local => \undef
# spent 47µs making 1 call to Variable::Magic::wizard
25;
26
27
# spent 63µs (31+31) within B::Hooks::EndOfScope::XS::on_scope_end which was called 2 times, avg 31µs/call: # once (21µs+23µs) by namespace::clean::import at line 178 of namespace/clean.pm # once (10µs+9µs) by namespace::autoclean::import at line 183 of namespace/autoclean.pm
sub on_scope_end (&) {
2821µs my $cb = shift;
29
3022µs $^H |= 0x020000;
31
32230µs26µs if (my $stack = Variable::Magic::getdata %^H, $wiz) {
# spent 6µs making 2 calls to Variable::Magic::getdata, avg 3µs/call
33 push @{ $stack }, $cb;
34 }
35 else {
36224µs430µs Variable::Magic::cast %^H, $wiz, $cb;
# spent 26µs making 2 calls to Variable::Magic::cast, avg 13µs/call # spent 4µs making 2 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
6015µs1;
61
62__END__