← 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 13:01:18 2016
Reported on Fri Jan 8 13:01:36 2016

Filename/usr/share/perl5/Context/Preserve.pm
StatementsExecuted 51 statements in 445µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
41178µs1.57msContext::Preserve::::preserve_contextContext::Preserve::preserve_context
11115µs22µsContext::Preserve::::BEGIN@2Context::Preserve::BEGIN@2
1119µs44µsContext::Preserve::::BEGIN@4Context::Preserve::BEGIN@4
1118µs39µsContext::Preserve::::BEGIN@6Context::Preserve::BEGIN@6
1117µ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;
2235µs228µs
# spent 22µs (15+6) within Context::Preserve::BEGIN@2 which was called: # once (15µs+6µ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 6µs making 1 call to strict::import
3226µs214µs
# spent 11µs (7+4) within Context::Preserve::BEGIN@3 which was called: # once (7µ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
4263µs278µs
# spent 44µs (9+34) within Context::Preserve::BEGIN@4 which was called: # once (9µs+34µs) by DBIx::Class::Storage::BlockRunner::BEGIN@9 at line 4
use Carp;
# spent 44µs making 1 call to Context::Preserve::BEGIN@4 # spent 34µs making 1 call to Exporter::import
5
62248µs239µs
# spent 39µs (8+31) within Context::Preserve::BEGIN@6 which was called: # once (8µs+31µs) by DBIx::Class::Storage::BlockRunner::BEGIN@9 at line 6
use base 'Exporter';
# spent 39µs making 1 call to Context::Preserve::BEGIN@6 # spent 30µs making 1 call to base::import, recursion: max depth 2, sum of overlapping time 30µs
71900nsour @EXPORT = qw(preserve_context);
8
91200nsour $VERSION = '0.01';
10
11
# spent 1.57ms (78µs+1.49) within Context::Preserve::preserve_context which was called 4 times, avg 393µs/call: # 4 times (78µs+1.49ms) by DBIx::Class::Storage::BlockRunner::_run at line 233 of DBIx/Class/Storage/BlockRunner.pm, avg 393µs/call
sub preserve_context(&@) {
1241µs my $orig = shift;
1346µs my %args = @_;
14
1542µs my $replace = $args{replace};
1642µs my $after = $args{after};
17
1842µs croak 'need an "after" or "replace" coderef'
19 unless $replace || $after;
20
2143µs if(!defined wantarray){
2216µs1374µs $orig->();
231600ns if($after){
24 $after->();
25 }
26 else {
2712µs122µs $replace->();
28 }
2914µs return;
30 }
31 elsif(wantarray){
32320µs31.05ms my @result = $orig->();
3332µs if($after){
34 my @ignored = $after->(@result);
35 }
36 else {
3738µs342µs @result = $replace->(@result);
38 }
39310µ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__