← 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:36 2016

Filename/usr/share/perl5/DBIx/Class/Carp.pm
StatementsExecuted 147 statements in 1.56ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
171717465µs732µsDBIx::Class::Carp::::importDBIx::Class::Carp::import
1711238µs238µsDBIx::Class::Carp::::CORE:regcompDBIx::Class::Carp::CORE:regcomp (opcode)
171128µs28µsDBIx::Class::Carp::::CORE:qrDBIx::Class::Carp::CORE:qr (opcode)
11115µs26µsDBIx::Class::Carp::::BEGIN@4DBIx::Class::Carp::BEGIN@4
11111µs19µsDBIx::Class::Carp::::BEGIN@86DBIx::Class::Carp::BEGIN@86
11111µs19µsDBIx::Class::Carp::::BEGIN@5DBIx::Class::Carp::BEGIN@5
1113µs3µsDBIx::Class::Carp::::BEGIN@9DBIx::Class::Carp::BEGIN@9
0000s0sDBIx::Class::Carp::::__ANON__[:104]DBIx::Class::Carp::__ANON__[:104]
0000s0sDBIx::Class::Carp::::__ANON__[:121]DBIx::Class::Carp::__ANON__[:121]
0000s0sDBIx::Class::Carp::::__ANON__[:75]DBIx::Class::Carp::__ANON__[:75]
0000s0sDBIx::Class::Carp::::__ANON__[:93]DBIx::Class::Carp::__ANON__[:93]
0000s0sDBIx::Class::Carp::::__find_callerDBIx::Class::Carp::__find_caller
0000s0sDBIx::Class::Carp::::unimportDBIx::Class::Carp::unimport
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package # hide from pause
2 DBIx::Class::Carp;
3
4241µs237µs
# spent 26µs (15+11) within DBIx::Class::Carp::BEGIN@4 which was called: # once (15µs+11µs) by DBIx::Class::_Util::BEGIN@56 at line 4
use strict;
# spent 26µs making 1 call to DBIx::Class::Carp::BEGIN@4 # spent 11µs making 1 call to strict::import
5238µs228µs
# spent 19µs (11+8) within DBIx::Class::Carp::BEGIN@5 which was called: # once (11µs+8µs) by DBIx::Class::_Util::BEGIN@56 at line 5
use warnings;
# spent 19µs making 1 call to DBIx::Class::Carp::BEGIN@5 # spent 8µs making 1 call to warnings::import
6
7# load Carp early to prevent tickling of the ::Internal stash being
8# interpreted as "Carp is already loaded" by some braindead loader
92432µs13µs
# spent 3µs within DBIx::Class::Carp::BEGIN@9 which was called: # once (3µs+0s) by DBIx::Class::_Util::BEGIN@56 at line 9
use Carp ();
# spent 3µs making 1 call to DBIx::Class::Carp::BEGIN@9
1012µs$Carp::Internal{ (__PACKAGE__) }++;
11
12sub __find_caller {
13 my ($skip_pattern, $class) = @_;
14
15 my $skip_class_data = $class->_skip_namespace_frames
16 if ($class and $class->can('_skip_namespace_frames'));
17
18 $skip_pattern = qr/$skip_pattern|$skip_class_data/
19 if $skip_class_data;
20
21 my $fr_num = 1; # skip us and the calling carp*
22
23 my (@f, $origin);
24 while (@f = caller($fr_num++)) {
25
26 next if
27 ( $f[3] eq '(eval)' or $f[3] =~ /::__ANON__$/ );
28
29 $origin ||= (
30 $f[3] =~ /^ (.+) :: ([^\:]+) $/x
31 and
32 ! $Carp::Internal{$1}
33 and
34 $1 !~ /^(?: DBIx::Class::Storage::BlockRunner | Context::Preserve | Try::Tiny | Class::Accessor::Grouped | Class::C3::Componentised | Module::Runtime )$/x
35
36
37 and
38 $2 !~ /^(?: throw_exception | carp | carp_unique | carp_once | dbh_do | txn_do | with_deferred_fk_checks)$/x
39#############################
40 ) ? $f[3] : undef;
41
42 if (
43 $f[0]->can('_skip_namespace_frames')
44 and
45 my $extra_skip = $f[0]->_skip_namespace_frames
46 ) {
47 $skip_pattern = qr/$skip_pattern|$extra_skip/;
48 }
49
50 last if $f[0] !~ $skip_pattern;
51 }
52
53 my $site = @f # if empty - nothing matched - full stack
54 ? "at $f[1] line $f[2]"
55 : Carp::longmess()
56 ;
57 $origin ||= '{UNKNOWN}';
58
59 return (
60 $site,
61 $origin =~ /::/ ? "$origin(): " : "$origin: ", # cargo-cult from Carp::Clan
62 );
63};
64
65my $warn = sub {
66 my ($ln, @warn) = @_;
67 @warn = "Warning: something's wrong" unless @warn;
68
69 # back-compat with Carp::Clan - a warning ending with \n does
70 # not include caller info
71 warn (
72 @warn,
73 $warn[-1] =~ /\n$/ ? '' : " $ln\n"
74 );
7513µs};
76
77
# spent 732µs (465+267) within DBIx::Class::Carp::import which was called 17 times, avg 43µs/call: # once (40µs+19µs) by DBIx::Class::Storage::BEGIN@15 at line 15 of DBIx/Class/Storage.pm # once (29µs+28µs) by DBIx::Class::ResultSource::BEGIN@11 at line 11 of DBIx/Class/ResultSource.pm # once (26µs+24µs) by DBIx::Class::Storage::TxnScopeGuard::BEGIN@9 at line 9 of DBIx/Class/Storage/TxnScopeGuard.pm # once (37µs+13µs) by DBIx::Class::Storage::DBI::BEGIN@10 at line 10 of DBIx/Class/Storage/DBI.pm # once (32µs+13µs) by DBIx::Class::Relationship::HasOne::BEGIN@6 at line 6 of DBIx/Class/Relationship/HasOne.pm # once (26µs+19µs) by DBIx::Class::Relationship::Accessor::BEGIN@6 at line 6 of DBIx/Class/Relationship/Accessor.pm # once (28µs+16µs) by DBIx::Class::Row::BEGIN@11 at line 11 of DBIx/Class/Row.pm # once (28µs+16µs) by DBIx::Class::Schema::BEGIN@8 at line 8 of DBIx/Class/Schema.pm # once (30µs+12µs) by DBIx::Class::Relationship::ManyToMany::BEGIN@7 at line 7 of DBIx/Class/Relationship/ManyToMany.pm # once (30µs+12µs) by DBIx::Class::SQLMaker::BEGIN@42 at line 42 of DBIx/Class/SQLMaker.pm # once (28µs+13µs) by DBIx::Class::ResultSet::BEGIN@6 at line 6 of DBIx/Class/ResultSet.pm # once (28µs+14µs) by DBIx::Class::Componentised::BEGIN@10 at line 10 of DBIx/Class/Componentised.pm # once (20µs+19µs) by DBIx::Class::Relationship::CascadeActions::BEGIN@6 at line 6 of DBIx/Class/Relationship/CascadeActions.pm # once (22µs+15µs) by DBIx::Class::Storage::DBIHacks::BEGIN@20 at line 20 of DBIx/Class/Storage/DBIHacks.pm # once (24µs+13µs) by DBIx::Class::_Util::BEGIN@56 at line 56 of DBIx/Class/_Util.pm # once (18µs+11µs) by DBIx::Class::Storage::BlockRunner::BEGIN@8 at line 8 of DBIx/Class/Storage/BlockRunner.pm # once (17µs+10µs) by DBIx::Class::ResultSetColumn::BEGIN@7 at line 7 of DBIx/Class/ResultSetColumn.pm
sub import {
781716µs my (undef, $skip_pattern) = @_;
791715µs my $into = caller;
80
8117375µs34267µs $skip_pattern = $skip_pattern
# spent 238µs making 17 calls to DBIx::Class::Carp::CORE:regcomp, avg 14µs/call # spent 28µs making 17 calls to DBIx::Class::Carp::CORE:qr, avg 2µs/call
82 ? qr/ ^ $into $ | $skip_pattern /x
83 : qr/ ^ $into $ /x
84 ;
85
862275µs226µs
# spent 19µs (11+7) within DBIx::Class::Carp::BEGIN@86 which was called: # once (11µs+7µs) by DBIx::Class::_Util::BEGIN@56 at line 86
no strict 'refs';
# spent 19µs making 1 call to DBIx::Class::Carp::BEGIN@86 # spent 7µs making 1 call to strict::unimport
87
88 *{"${into}::carp"} = sub {
89 $warn->(
90 __find_caller($skip_pattern, $into),
91 @_
92 );
9317132µs };
94
951720µs my $fired = {};
96 *{"${into}::carp_once"} = sub {
97 return if $fired->{$_[0]};
98 $fired->{$_[0]} = 1;
99
100 $warn->(
101 __find_caller($skip_pattern, $into),
102 @_,
103 );
1041771µs };
105
106174µs my $seen;
107 *{"${into}::carp_unique"} = sub {
108 my ($ln, $calling) = __find_caller($skip_pattern, $into);
109 my $msg = join ('', $calling, @_);
110
111 # unique carping with a hidden caller makes no sense
112 $msg =~ s/\n+$//;
113
114 return if $seen->{$ln}{$msg};
115 $seen->{$ln}{$msg} = 1;
116
117 $warn->(
118 $ln,
119 $msg,
120 );
12117135µs };
122}
123
124sub unimport {
125 die (__PACKAGE__ . " does not implement unimport yet\n");
126}
127
12813µs1;
129
130__END__
 
# spent 28µs within DBIx::Class::Carp::CORE:qr which was called 17 times, avg 2µs/call: # 17 times (28µs+0s) by DBIx::Class::Carp::import at line 81, avg 2µs/call
sub DBIx::Class::Carp::CORE:qr; # opcode
# spent 238µs within DBIx::Class::Carp::CORE:regcomp which was called 17 times, avg 14µs/call: # 17 times (238µs+0s) by DBIx::Class::Carp::import at line 81, avg 14µs/call
sub DBIx::Class::Carp::CORE:regcomp; # opcode