← 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:50:58 2016
Reported on Fri Jan 8 13:51:28 2016

Filename/usr/share/perl5/Context/Preserve.pm
StatementsExecuted 30021 statements in 62.2ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
30011177.5ms962msContext::Preserve::::preserve_contextContext::Preserve::preserve_context
11118µs24µsContext::Preserve::::BEGIN@2Context::Preserve::BEGIN@2
11110µs42µsContext::Preserve::::BEGIN@4Context::Preserve::BEGIN@4
1118µs38µsContext::Preserve::::BEGIN@6Context::Preserve::BEGIN@6
1117µs10µ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;
2236µs230µs
# spent 24µs (18+6) within Context::Preserve::BEGIN@2 which was called: # once (18µs+6µs) by DBIx::Class::Storage::BlockRunner::BEGIN@9 at line 2
use strict;
# spent 24µs making 1 call to Context::Preserve::BEGIN@2 # spent 6µs making 1 call to strict::import
3226µs214µs
# spent 10µ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 10µs making 1 call to Context::Preserve::BEGIN@3 # spent 4µs making 1 call to warnings::import
4262µs274µs
# spent 42µs (10+32) within Context::Preserve::BEGIN@4 which was called: # once (10µs+32µs) by DBIx::Class::Storage::BlockRunner::BEGIN@9 at line 4
use Carp;
# spent 42µs making 1 call to Context::Preserve::BEGIN@4 # spent 32µs making 1 call to Exporter::import
5
62244µs238µs
# spent 38µs (8+30) within Context::Preserve::BEGIN@6 which was called: # once (8µs+30µs) by DBIx::Class::Storage::BlockRunner::BEGIN@9 at line 6
use base 'Exporter';
# spent 38µ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
711µsour @EXPORT = qw(preserve_context);
8
91100nsour $VERSION = '0.01';
10
11
# spent 962ms (77.5+885) within Context::Preserve::preserve_context which was called 3001 times, avg 321µs/call: # 3001 times (77.5ms+885ms) by DBIx::Class::Storage::BlockRunner::_run at line 233 of DBIx/Class/Storage/BlockRunner.pm, avg 321µs/call
sub preserve_context(&@) {
1230011.14ms my $orig = shift;
1330014.29ms my %args = @_;
14
1530011.77ms my $replace = $args{replace};
1630011.69ms my $after = $args{after};
17
1830011.61ms croak 'need an "after" or "replace" coderef'
19 unless $replace || $after;
20
2130012.57ms if(!defined wantarray){
2217µs1448µs $orig->();
231800ns if($after){
24 $after->();
25 }
26 else {
2712µs124µs $replace->();
28 }
2915µs return;
30 }
31 elsif(wantarray){
32300021.9ms3000833ms my @result = $orig->();
# spent 833ms making 3000 calls to DBIx::Class::Storage::BlockRunner::__ANON__[DBIx/Class/Storage/BlockRunner.pm:155], avg 278µs/call
3330002.50ms if($after){
34 my @ignored = $after->(@result);
35 }
36 else {
3730008.50ms300051.0ms @result = $replace->(@result);
# spent 51.0ms making 3000 calls to DBIx::Class::Storage::BlockRunner::__ANON__[DBIx/Class/Storage/BlockRunner.pm:233], avg 17µs/call
38 }
39300015.9ms 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
5313µs1;
54__END__