← 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:16:49 2016
Reported on Fri Jan 8 14:23:09 2016

Filename/usr/share/perl5/Context/Preserve.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11150µs777µsContext::Preserve::::preserve_contextContext::Preserve::preserve_context
11114µs20µsContext::Preserve::::BEGIN@2Context::Preserve::BEGIN@2
11110µs47µsContext::Preserve::::BEGIN@4Context::Preserve::BEGIN@4
1118µs40µsContext::Preserve::::BEGIN@6Context::Preserve::BEGIN@6
1118µs11µsContext::Preserve::::BEGIN@3Context::Preserve::BEGIN@3
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;
2227µs
# spent 20µs (14+6) within Context::Preserve::BEGIN@2 which was called: # once (14µs+6µs) by DBIx::Class::Storage::BlockRunner::BEGIN@9 at line 2
use strict;
# spent 20µs making 1 call to Context::Preserve::BEGIN@2 # spent 6µs making 1 call to strict::import
3215µs
# spent 11µs (8+4) within Context::Preserve::BEGIN@3 which was called: # once (8µs+4µs) by DBIx::Class::Storage::BlockRunner::BEGIN@9 at line 3
use warnings;
# spent 11µs making 1 call to Context::Preserve::BEGIN@3 # spent 4µs making 1 call to warnings::import
4283µs
# spent 47µs (10+36) within Context::Preserve::BEGIN@4 which was called: # once (10µs+36µs) by DBIx::Class::Storage::BlockRunner::BEGIN@9 at line 4
use Carp;
# spent 47µs making 1 call to Context::Preserve::BEGIN@4 # spent 36µs making 1 call to Exporter::import
5
6240µs
# spent 40µs (8+32) within Context::Preserve::BEGIN@6 which was called: # once (8µs+32µs) by DBIx::Class::Storage::BlockRunner::BEGIN@9 at line 6
use base 'Exporter';
# spent 40µs making 1 call to Context::Preserve::BEGIN@6 # spent 32µs making 1 call to base::import, recursion: max depth 2, sum of overlapping time 32µs
7our @EXPORT = qw(preserve_context);
8
9our $VERSION = '0.01';
10
11
# spent 777µs (50+727) within Context::Preserve::preserve_context which was called: # once (50µs+727µs) by DBIx::Class::Storage::BlockRunner::_run at line 233 of DBIx/Class/Storage/BlockRunner.pm
sub preserve_context(&@) {
12 my $orig = shift;
13 my %args = @_;
14
15 my $replace = $args{replace};
16 my $after = $args{after};
17
18 croak 'need an "after" or "replace" coderef'
19 unless $replace || $after;
20
21 if(!defined wantarray){
221690µs $orig->();
23 if($after){
24 $after->();
25 }
26 else {
27137µs $replace->();
28 }
29 return;
30 }
31 elsif(wantarray){
32 my @result = $orig->();
33 if($after){
34 my @ignored = $after->(@result);
35 }
36 else {
37 @result = $replace->(@result);
38 }
39 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
531;
54__END__