Filename | /usr/local/share/perl/5.18.2/Return/MultiLevel.pm |
Statements | Executed 400020 statements in 2.48s |
Calls | P | F | Exclusive Time |
Inclusive Time |
Subroutine |
---|---|---|---|---|---|
100001 | 1 | 1 | 2.32s | 148s | __ANON__[:25] | Return::MultiLevel::
1 | 1 | 1 | 10µs | 13µs | BEGIN@3 | Return::MultiLevel::
1 | 1 | 1 | 7µs | 23µs | BEGIN@9 | Return::MultiLevel::
1 | 1 | 1 | 6µs | 27µs | BEGIN@8 | Return::MultiLevel::
1 | 1 | 1 | 6µs | 15µs | BEGIN@4 | Return::MultiLevel::
0 | 0 | 0 | 0s | 0s | __ANON__[:24] | Return::MultiLevel::
0 | 0 | 0 | 0s | 0s | __ANON__[:45] | Return::MultiLevel::
0 | 0 | 0 | 0s | 0s | __ANON__[:55] | Return::MultiLevel::
Line | State ments |
Time on line |
Calls | Time in subs |
Code |
---|---|---|---|---|---|
1 | package Return::MultiLevel; | ||||
2 | |||||
3 | 2 | 19µs | 2 | 17µs | # spent 13µs (10+4) within Return::MultiLevel::BEGIN@3 which was called:
# once (10µs+4µs) by PONAPI::Server::BEGIN@13 at line 3 # spent 13µs making 1 call to Return::MultiLevel::BEGIN@3
# spent 4µs making 1 call to warnings::import |
4 | 2 | 29µs | 2 | 24µs | # spent 15µs (6+9) within Return::MultiLevel::BEGIN@4 which was called:
# once (6µs+9µs) by PONAPI::Server::BEGIN@13 at line 4 # spent 15µs making 1 call to Return::MultiLevel::BEGIN@4
# spent 9µs making 1 call to strict::import |
5 | |||||
6 | 1 | 400ns | our $VERSION = '0.03'; | ||
7 | |||||
8 | 2 | 20µs | 2 | 48µs | # spent 27µs (6+21) within Return::MultiLevel::BEGIN@8 which was called:
# once (6µs+21µs) by PONAPI::Server::BEGIN@13 at line 8 # spent 27µs making 1 call to Return::MultiLevel::BEGIN@8
# spent 21µs making 1 call to Exporter::import |
9 | 2 | 269µs | 2 | 40µs | # spent 23µs (7+16) within Return::MultiLevel::BEGIN@9 which was called:
# once (7µs+16µs) by PONAPI::Server::BEGIN@13 at line 9 # spent 23µs making 1 call to Return::MultiLevel::BEGIN@9
# spent 16µs making 1 call to parent::import |
10 | |||||
11 | 1 | 800ns | our @EXPORT_OK = qw(with_return); | ||
12 | |||||
13 | 1 | 100ns | our $_backend; | ||
14 | |||||
15 | 2 | 55µs | if (!$ENV{RETURN_MULTILEVEL_PP} && eval { require Scope::Upper }) { | ||
16 | # spent 148s (2.32+145) within Return::MultiLevel::__ANON__[/usr/local/share/perl/5.18.2/Return/MultiLevel.pm:25] which was called 100001 times, avg 1.48ms/call:
# 100001 times (2.32s+145s) by PONAPI::Server::call at line 68 of lib/PONAPI/Server.pm, avg 1.48ms/call | ||||
17 | 100001 | 80.7ms | my ($f) = @_; | ||
18 | 100001 | 46.2ms | my @ctx; | ||
19 | 100001 | 956ms | 100001 | 303ms | local $ctx[0] = Scope::Upper::HERE(); # spent 303ms making 100001 calls to Scope::Upper::HERE, avg 3µs/call |
20 | $f->(sub { | ||||
21 | defined $ctx[0] | ||||
22 | or confess "Attempt to re-enter dead call frame"; | ||||
23 | Scope::Upper::unwind(@_, $ctx[0]); | ||||
24 | }) | ||||
25 | 100002 | 1.40s | 100001 | 145s | }; # spent 145s making 100001 calls to PONAPI::Server::__ANON__[lib/PONAPI/Server.pm:68], avg 1.45ms/call |
26 | |||||
27 | 1 | 400ns | $_backend = 'XS'; | ||
28 | |||||
29 | } else { | ||||
30 | |||||
31 | our $uniq = 0; | ||||
32 | our @ret; | ||||
33 | |||||
34 | *with_return = sub (&) { | ||||
35 | my ($f) = @_; | ||||
36 | my @label; | ||||
37 | local $label[0] = __PACKAGE__ . '_' . $uniq; | ||||
38 | local $uniq = $uniq + 1; | ||||
39 | $label[0] =~ tr/A-Za-z0-9_/_/cs; | ||||
40 | my $r = sub { | ||||
41 | defined $label[0] | ||||
42 | or confess "Attempt to re-enter dead call frame"; | ||||
43 | @ret = @_; | ||||
44 | goto $label[0]; | ||||
45 | }; | ||||
46 | my $c = eval qq[ | ||||
47 | #line ${\(__LINE__ + 2)} "${\__FILE__}" | ||||
48 | sub { | ||||
49 | return \$f->(\$r); | ||||
50 | $label[0]: splice \@ret | ||||
51 | } | ||||
52 | ]; | ||||
53 | die $@ if $@; | ||||
54 | $c->() | ||||
55 | }; | ||||
56 | |||||
57 | $_backend = 'PP'; | ||||
58 | } | ||||
59 | |||||
60 | 1 | 4µs | 'ok' | ||
61 | |||||
62 | __END__ |