← Index
NYTProf Performance Profile   « line view »
For starman worker -M FindBin --max-requests 50 --workers 2 --user=kohadev-koha --group kohadev-koha --pid /var/run/koha/kohadev/plack.pid --daemonize --access-log /var/log/koha/kohadev/plack.log --error-log /var/log/koha/kohadev/plack-error.log -E deployment --socket /var/run/koha/kohadev/plack.sock /etc/koha/sites/kohadev/plack.psgi
  Run on Fri Jan 8 14:31:06 2016
Reported on Fri Jan 8 14:31:38 2016

Filename/usr/share/perl5/Context/Preserve.pm
StatementsExecuted 901 statements in 1.62ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
89117.37ms29.6msContext::Preserve::::preserve_contextContext::Preserve::preserve_context
11115µs22µsContext::Preserve::::BEGIN@2Context::Preserve::BEGIN@2
1110s0sContext::Preserve::::BEGIN@3Context::Preserve::BEGIN@3
1110s0sContext::Preserve::::BEGIN@4Context::Preserve::BEGIN@4
1110s0sContext::Preserve::::BEGIN@6Context::Preserve::BEGIN@6
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Context::Preserve;
2213µs229µs
# spent 22µs (15+7) within Context::Preserve::BEGIN@2 which was called: # once (15µs+7µs) by DBIx::Class::Storage::BlockRunner::BEGIN@9 at line 2
use strict;
# spent 22µs making 1 call to Context::Preserve::BEGIN@2 # spent 7µs making 1 call to strict::import
32100ns20s
# spent 0s within Context::Preserve::BEGIN@3 which was called: # once (0s+0s) by DBIx::Class::Storage::BlockRunner::BEGIN@9 at line 3
use warnings;
# spent 0s making 1 call to Context::Preserve::BEGIN@3 # spent 0s making 1 call to warnings::import
42200ns20s
# spent 0s within Context::Preserve::BEGIN@4 which was called: # once (0s+0s) by DBIx::Class::Storage::BlockRunner::BEGIN@9 at line 4
use Carp;
# spent 0s making 1 call to Context::Preserve::BEGIN@4 # spent 0s making 1 call to Exporter::import
5
6252µs20s
# spent 0s within Context::Preserve::BEGIN@6 which was called: # once (0s+0s) by DBIx::Class::Storage::BlockRunner::BEGIN@9 at line 6
use base 'Exporter';
# spent 0s making 1 call to Context::Preserve::BEGIN@6 # spent 0s making 1 call to base::import, recursion: max depth 2, sum of overlapping time 0s
711µsour @EXPORT = qw(preserve_context);
8
91200nsour $VERSION = '0.01';
10
11
# spent 29.6ms (7.37+22.2) within Context::Preserve::preserve_context which was called 89 times, avg 332µs/call: # 89 times (7.37ms+22.2ms) by DBIx::Class::Storage::BlockRunner::_run at line 233 of DBIx/Class/Storage/BlockRunner.pm, avg 332µs/call
sub preserve_context(&@) {
128928µs my $orig = shift;
1389119µs my %args = @_;
14
158960µs my $replace = $args{replace};
168959µs my $after = $args{after};
17
188926µs croak 'need an "after" or "replace" coderef'
19 unless $replace || $after;
20
218971µs if(!defined wantarray){
2217µs1430µs $orig->();
231600ns if($after){
24 $after->();
25 }
26 else {
2712µs123µs $replace->();
28 }
2915µs return;
30 }
31 elsif(wantarray){
3288556µs8820.5ms my @result = $orig->();
338863µs if($after){
34 my @ignored = $after->(@result);
35 }
36 else {
3788240µs881.26ms @result = $replace->(@result);
38 }
3988315µs return @result;
40 }
41 else {
42 my $result = $orig->();
43 if($after){
44 my $ignored = $after->($result);
45 }
46 else {
47 $result = $replace->($result);
48 }
49 return $result;
50 }
51}
52
5314µs1;
54__END__