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

Filename/usr/share/perl5/DBIx/Class/Carp.pm
StatementsExecuted 0 statements in 0s
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
161616402µs643µsDBIx::Class::Carp::::importDBIx::Class::Carp::import
1611212µs212µsDBIx::Class::Carp::::CORE:regcompDBIx::Class::Carp::CORE:regcomp (opcode)
161128µs28µsDBIx::Class::Carp::::CORE:qrDBIx::Class::Carp::CORE:qr (opcode)
11117µs27µsDBIx::Class::Carp::::BEGIN@4DBIx::Class::Carp::BEGIN@4
11110µs17µsDBIx::Class::Carp::::BEGIN@86DBIx::Class::Carp::BEGIN@86
1118µs17µsDBIx::Class::Carp::::BEGIN@5DBIx::Class::Carp::BEGIN@5
1114µs4µ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
4237µs
# spent 27µs (17+10) within DBIx::Class::Carp::BEGIN@4 which was called: # once (17µs+10µs) by DBIx::Class::_Util::BEGIN@56 at line 4
use strict;
# spent 27µs making 1 call to DBIx::Class::Carp::BEGIN@4 # spent 10µs making 1 call to strict::import
5225µs
# spent 17µs (8+8) within DBIx::Class::Carp::BEGIN@5 which was called: # once (8µs+8µs) by DBIx::Class::_Util::BEGIN@56 at line 5
use warnings;
# spent 17µ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
914µs
# spent 4µs within DBIx::Class::Carp::BEGIN@9 which was called: # once (4µs+0s) by DBIx::Class::_Util::BEGIN@56 at line 9
use Carp ();
# spent 4µs making 1 call to DBIx::Class::Carp::BEGIN@9
10$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 );
75};
76
77
# spent 643µs (402+241) within DBIx::Class::Carp::import which was called 16 times, avg 40µs/call: # once (34µs+20µs) by DBIx::Class::Storage::BEGIN@15 at line 15 of DBIx/Class/Storage.pm # once (34µs+17µs) by DBIx::Class::Row::BEGIN@11 at line 11 of DBIx/Class/Row.pm # once (34µs+16µs) by DBIx::Class::Relationship::Accessor::BEGIN@6 at line 6 of DBIx/Class/Relationship/Accessor.pm # once (30µs+18µs) by DBIx::Class::ResultSet::BEGIN@6 at line 6 of DBIx/Class/ResultSet.pm # once (27µs+21µs) by DBIx::Class::Storage::DBIHacks::BEGIN@20 at line 20 of DBIx/Class/Storage/DBIHacks.pm # once (26µs+21µs) by DBIx::Class::Storage::TxnScopeGuard::BEGIN@9 at line 9 of DBIx/Class/Storage/TxnScopeGuard.pm # once (27µs+15µs) by DBIx::Class::Componentised::BEGIN@10 at line 10 of DBIx/Class/Componentised.pm # once (28µs+13µs) by DBIx::Class::_Util::BEGIN@56 at line 56 of DBIx/Class/_Util.pm # once (27µs+12µs) by DBIx::Class::Relationship::HasOne::BEGIN@6 at line 6 of DBIx/Class/Relationship/HasOne.pm # once (26µs+14µs) by DBIx::Class::ResultSource::BEGIN@11 at line 11 of DBIx/Class/ResultSource.pm # once (25µs+11µs) by DBIx::Class::Schema::BEGIN@8 at line 8 of DBIx/Class/Schema.pm # once (15µs+19µs) by DBIx::Class::Storage::DBI::BEGIN@10 at line 10 of DBIx/Class/Storage/DBI.pm # once (18µs+13µs) by DBIx::Class::Relationship::CascadeActions::BEGIN@6 at line 6 of DBIx/Class/Relationship/CascadeActions.pm # once (18µs+11µs) by DBIx::Class::Relationship::ManyToMany::BEGIN@7 at line 7 of DBIx/Class/Relationship/ManyToMany.pm # once (17µs+10µ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 {
78 my (undef, $skip_pattern) = @_;
79 my $into = caller;
80
8132241µs $skip_pattern = $skip_pattern
# spent 212µs making 16 calls to DBIx::Class::Carp::CORE:regcomp, avg 13µs/call # spent 28µs making 16 calls to DBIx::Class::Carp::CORE:qr, avg 2µs/call
82 ? qr/ ^ $into $ | $skip_pattern /x
83 : qr/ ^ $into $ /x
84 ;
85
86224µs
# spent 17µs (10+7) within DBIx::Class::Carp::BEGIN@86 which was called: # once (10µs+7µs) by DBIx::Class::_Util::BEGIN@56 at line 86
no strict 'refs';
# spent 17µ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 );
93 };
94
95 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 );
104 };
105
106 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 );
121 };
122}
123
124sub unimport {
125 die (__PACKAGE__ . " does not implement unimport yet\n");
126}
127
1281;
129
130__END__
 
# spent 28µs within DBIx::Class::Carp::CORE:qr which was called 16 times, avg 2µs/call: # 16 times (28µs+0s) by DBIx::Class::Carp::import at line 81, avg 2µs/call
sub DBIx::Class::Carp::CORE:qr; # opcode
# spent 212µs within DBIx::Class::Carp::CORE:regcomp which was called 16 times, avg 13µs/call: # 16 times (212µs+0s) by DBIx::Class::Carp::import at line 81, avg 13µs/call
sub DBIx::Class::Carp::CORE:regcomp; # opcode