← Index
NYTProf Performance Profile   « line view »
For script/ponapi
  Run on Wed Feb 10 15:51:26 2016
Reported on Thu Feb 11 09:43:10 2016

Filename/usr/local/share/perl/5.18.2/Return/MultiLevel.pm
StatementsExecuted 400020 statements in 2.48s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
100001112.32s148sReturn::MultiLevel::::__ANON__[:25]Return::MultiLevel::__ANON__[:25]
11110µs13µsReturn::MultiLevel::::BEGIN@3Return::MultiLevel::BEGIN@3
1117µs23µsReturn::MultiLevel::::BEGIN@9Return::MultiLevel::BEGIN@9
1116µs27µsReturn::MultiLevel::::BEGIN@8Return::MultiLevel::BEGIN@8
1116µs15µsReturn::MultiLevel::::BEGIN@4Return::MultiLevel::BEGIN@4
0000s0sReturn::MultiLevel::::__ANON__[:24]Return::MultiLevel::__ANON__[:24]
0000s0sReturn::MultiLevel::::__ANON__[:45]Return::MultiLevel::__ANON__[:45]
0000s0sReturn::MultiLevel::::__ANON__[:55]Return::MultiLevel::__ANON__[:55]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Return::MultiLevel;
2
3219µs217µ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
use warnings;
# spent 13µs making 1 call to Return::MultiLevel::BEGIN@3 # spent 4µs making 1 call to warnings::import
4229µs224µ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
use strict;
# spent 15µs making 1 call to Return::MultiLevel::BEGIN@4 # spent 9µs making 1 call to strict::import
5
61400nsour $VERSION = '0.03';
7
8220µs248µ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
use Carp qw(confess);
# spent 27µs making 1 call to Return::MultiLevel::BEGIN@8 # spent 21µs making 1 call to Exporter::import
92269µs240µ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
use parent 'Exporter';
# spent 23µs making 1 call to Return::MultiLevel::BEGIN@9 # spent 16µs making 1 call to parent::import
10
111800nsour @EXPORT_OK = qw(with_return);
12
131100nsour $_backend;
14
15255µsif (!$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
*with_return = sub (&) {
1710000180.7ms my ($f) = @_;
1810000146.2ms my @ctx;
19100001956ms100001303ms 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 })
251000021.40s100001145s };
# spent 145s making 100001 calls to PONAPI::Server::__ANON__[lib/PONAPI/Server.pm:68], avg 1.45ms/call
26
271400ns $_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
6014µs'ok'
61
62__END__