← Index
NYTProf Performance Profile   « block view • line view • sub view »
For 05.Domain_and_Item.t
  Run on Tue May 4 17:21:41 2010
Reported on Tue May 4 17:23:00 2010

File /usr/local/lib/perl5/site_perl/5.10.1/B/Hooks/EndOfScope.pm
Statements Executed 51
Statement Execution Time 519µs
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111547µs993µsB::Hooks::EndOfScope::::BEGIN@7B::Hooks::EndOfScope::BEGIN@7
11148µs48µsB::Hooks::EndOfScope::::BEGIN@6B::Hooks::EndOfScope::BEGIN@6
41140µs73µsB::Hooks::EndOfScope::::on_scope_endB::Hooks::EndOfScope::on_scope_end
44431µs3.04msB::Hooks::EndOfScope::::__ANON__[:47]B::Hooks::EndOfScope::__ANON__[:47]
11121µs23µsnamespace::clean::::BEGIN@1 namespace::clean::BEGIN@1
11111µs384µsB::Hooks::EndOfScope::::BEGIN@11B::Hooks::EndOfScope::BEGIN@11
1118µs16µsnamespace::clean::::BEGIN@2 namespace::clean::BEGIN@2
4116µs6µsB::Hooks::EndOfScope::::__ANON__[:46]B::Hooks::EndOfScope::__ANON__[:46]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1321µs226µs
# spent 23µs (21+3) within namespace::clean::BEGIN@1 which was called # once (21µs+3µs) by namespace::clean::BEGIN@14 at line 1
use strict;
# spent 23µs making 1 call to namespace::clean::BEGIN@1 # spent 3µs making 1 call to strict::import
2329µs225µs
# spent 16µs (8+9) within namespace::clean::BEGIN@2 which was called # once (8µs+9µs) by namespace::clean::BEGIN@14 at line 2
use warnings;
# spent 16µs making 1 call to namespace::clean::BEGIN@2 # spent 9µs making 1 call to warnings::import
3
4package B::Hooks::EndOfScope;
5
6366µs148µs
# spent 48µs within B::Hooks::EndOfScope::BEGIN@6 which was called # once (48µs+0s) by namespace::clean::BEGIN@14 at line 6
use 5.008000;
# spent 48µs making 1 call to B::Hooks::EndOfScope::BEGIN@6
73127µs21.01ms
# spent 993µs (547+445) within B::Hooks::EndOfScope::BEGIN@7 which was called # once (547µs+445µs) by namespace::clean::BEGIN@14 at line 7
use Variable::Magic;
# spent 993µs making 1 call to B::Hooks::EndOfScope::BEGIN@7 # spent 18µs making 1 call to Exporter::import
8
91700nsour $VERSION = '0.08';
10
1117µs1373µs
# spent 384µs (11+373) within B::Hooks::EndOfScope::BEGIN@11 which was called # once (11µs+373µs) by namespace::clean::BEGIN@14 at line 14
use Sub::Exporter -setup => {
# spent 373µs making 1 call to Sub::Exporter::__ANON__[Sub/Exporter.pm:756]
12 exports => ['on_scope_end'],
13 groups => { default => ['on_scope_end'] },
142157µs1384µs};
# spent 384µs making 1 call to B::Hooks::EndOfScope::BEGIN@11
15
16=head1 NAME
17
18B::Hooks::EndOfScope - Execute code after a scope finished compilation
19
20=head1 SYNOPSIS
21
22 on_scope_end { ... };
23
24=head1 DESCRIPTION
25
26This module allows you to execute code when perl finished compiling the
27surrounding scope.
28
29=head1 FUNCTIONS
30
31=head2 on_scope_end
32
33 on_scope_end { ... };
34
35 on_scope_end $code;
36
37Registers C<$code> to be executed after the surrounding scope has been
38compiled.
39
40This is exported by default. See L<Sub::Exporter> on how to customize it.
41
42=cut
43
44{
451400ns my $wiz = Variable::Magic::wizard
46411µs
# spent 6µs within B::Hooks::EndOfScope::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/B/Hooks/EndOfScope.pm:46] which was called 4 times, avg 2µs/call: # 4 times (6µs+0s) by Variable::Magic::cast at line 58, avg 2µs/call
data => sub { [$_[1]] },
471333µs53.05ms
# spent 3.04ms (31µs+3.01) within B::Hooks::EndOfScope::__ANON__[/usr/local/lib/perl5/site_perl/5.10.1/B/Hooks/EndOfScope.pm:47] which was called 4 times, avg 761µs/call: # once (8µs+1.95ms) by MooseX::Types::BEGIN@12 at line 290 of MooseX/Types/Base.pm # once (8µs+614µs) by SimpleDB::Class::Types::BEGIN@77 at line 609 of MooseX/Types.pm # once (8µs+359µs) by SimpleDB::Class::Types::BEGIN@83 at line 83 of MooseX/Types/Moose.pm # once (7µs+86µs) by MooseX::Types::BEGIN@15 at line 101 of MooseX/Types/CheckedUtilExports.pm
free => sub { $_->() for @{ $_[1] }; () };
# spent 3.01ms making 4 calls to namespace::clean::__ANON__[namespace/clean.pm:275], avg 753µs/call # spent 38µs making 1 call to Variable::Magic::wizard
48
49
# spent 73µs (40+33) within B::Hooks::EndOfScope::on_scope_end which was called 4 times, avg 18µs/call: # 4 times (40µs+33µs) by namespace::clean::import at line 275 of namespace/clean.pm, avg 18µs/call
sub on_scope_end (&) {
5042µs my $cb = shift;
51
5244µs $^H |= 0x020000;
53
54426µs44µs if (my $stack = Variable::Magic::getdata %^H, $wiz) {
# spent 4µs making 4 calls to Variable::Magic::getdata, avg 900ns/call
55 push @{ $stack }, $cb;
56 }
57 else {
58428µs836µs Variable::Magic::cast %^H, $wiz, $cb;
# spent 29µs making 4 calls to Variable::Magic::cast, avg 7µs/call # spent 6µs making 4 calls to B::Hooks::EndOfScope::__ANON__[B/Hooks/EndOfScope.pm:46], avg 2µs/call
59 }
60 }
61}
62
63=head1 SEE ALSO
64
65L<Sub::Exporter>
66
67L<Variable::Magic>
68
69=head1 AUTHOR
70
71Florian Ragwitz E<lt>rafl@debian.orgE<gt>
72
73=head1 COPYRIGHT AND LICENSE
74
75Copyright (c) 2008 Florian Ragwitz
76
77This module is free software.
78
79You may distribute this code under the same terms as Perl itself.
80
81=cut
82
8317µs1;