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

Filename/usr/share/perl5/DBIx/Class/Relationship/Accessor.pm
StatementsExecuted 2405 statements in 15.6ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
319117.31ms97.3msDBIx::Class::Relationship::Accessor::::add_relationship_accessorDBIx::Class::Relationship::Accessor::add_relationship_accessor
319115.61ms108msDBIx::Class::Relationship::Accessor::::register_relationshipDBIx::Class::Relationship::Accessor::register_relationship
11116µs26µsDBIx::Class::Relationship::Accessor::::BEGIN@4DBIx::Class::Relationship::Accessor::BEGIN@4
1119µs130µsDBIx::Class::Relationship::Accessor::::BEGIN@8DBIx::Class::Relationship::Accessor::BEGIN@8
1118µs15µsDBIx::Class::Relationship::Accessor::::BEGIN@5DBIx::Class::Relationship::Accessor::BEGIN@5
1118µs36µsDBIx::Class::Relationship::Accessor::::BEGIN@7DBIx::Class::Relationship::Accessor::BEGIN@7
1118µs52µsDBIx::Class::Relationship::Accessor::::BEGIN@6DBIx::Class::Relationship::Accessor::BEGIN@6
0000s0sDBIx::Class::Relationship::Accessor::::__ANON__[:72]DBIx::Class::Relationship::Accessor::__ANON__[:72]
0000s0sDBIx::Class::Relationship::Accessor::::__ANON__[:94]DBIx::Class::Relationship::Accessor::__ANON__[:94]
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::Relationship::Accessor;
3
4241µs235µs
# spent 26µs (16+10) within DBIx::Class::Relationship::Accessor::BEGIN@4 which was called: # once (16µs+10µs) by Class::C3::Componentised::ensure_class_loaded at line 4
use strict;
# spent 26µs making 1 call to DBIx::Class::Relationship::Accessor::BEGIN@4 # spent 10µs making 1 call to strict::import
5238µs222µs
# spent 15µs (8+7) within DBIx::Class::Relationship::Accessor::BEGIN@5 which was called: # once (8µs+7µs) by Class::C3::Componentised::ensure_class_loaded at line 5
use warnings;
# spent 15µs making 1 call to DBIx::Class::Relationship::Accessor::BEGIN@5 # spent 7µs making 1 call to warnings::import
6233µs297µs
# spent 52µs (8+45) within DBIx::Class::Relationship::Accessor::BEGIN@6 which was called: # once (8µs+45µs) by Class::C3::Componentised::ensure_class_loaded at line 6
use DBIx::Class::Carp;
# spent 52µs making 1 call to DBIx::Class::Relationship::Accessor::BEGIN@6 # spent 45µs making 1 call to DBIx::Class::Carp::import
7255µs264µs
# spent 36µs (8+28) within DBIx::Class::Relationship::Accessor::BEGIN@7 which was called: # once (8µs+28µs) by Class::C3::Componentised::ensure_class_loaded at line 7
use DBIx::Class::_Util qw(quote_sub perlstring);
# spent 36µs making 1 call to DBIx::Class::Relationship::Accessor::BEGIN@7 # spent 28µs making 1 call to Exporter::import
82773µs2251µs
# spent 130µs (9+121) within DBIx::Class::Relationship::Accessor::BEGIN@8 which was called: # once (9µs+121µs) by Class::C3::Componentised::ensure_class_loaded at line 8
use namespace::clean;
# spent 130µs making 1 call to DBIx::Class::Relationship::Accessor::BEGIN@8 # spent 121µs making 1 call to namespace::clean::import
9
1012µsour %_pod_inherit_config =
11 (
12 class_map => { 'DBIx::Class::Relationship::Accessor' => 'DBIx::Class::Relationship' }
13 );
14
15
# spent 108ms (5.61+102) within DBIx::Class::Relationship::Accessor::register_relationship which was called 319 times, avg 338µs/call: # 319 times (5.61ms+102ms) by DBIx::Class::ResultSourceProxy::add_relationship at line 46 of DBIx/Class/ResultSourceProxy.pm, avg 338µs/call
sub register_relationship {
16319151µs my ($class, $rel, $info) = @_;
173191.73ms31997.3ms if (my $acc_type = $info->{attrs}{accessor}) {
# spent 97.3ms making 319 calls to DBIx::Class::Relationship::Accessor::add_relationship_accessor, avg 305µs/call
18 $class->add_relationship_accessor($rel => $acc_type);
19 }
203195.75ms3193.59ms $class->next::method($rel => $info);
# spent 3.59ms making 319 calls to next::method, avg 11µs/call
21}
22
23
# spent 97.3ms (7.31+90.0) within DBIx::Class::Relationship::Accessor::add_relationship_accessor which was called 319 times, avg 305µs/call: # 319 times (7.31ms+90.0ms) by DBIx::Class::Relationship::Accessor::register_relationship at line 17, avg 305µs/call
sub add_relationship_accessor {
24319145µs my ($class, $rel, $acc_type) = @_;
25
263191.41ms1068.71ms if ($acc_type eq 'single') {
# spent 8.57ms making 53 calls to Sub::Quote::quote_sub, avg 162µs/call # spent 140µs making 53 calls to DBIx::Class::_Util::perlstring, avg 3µs/call
27 quote_sub "${class}::${rel}" => sprintf(<<'EOC', perlstring $rel);
28 my $self = shift;
29
30 if (@_) {
31 $self->set_from_related( %1$s => @_ );
32 return $self->{_relationship_data}{%1$s} = $_[0];
33 }
34 elsif (exists $self->{_relationship_data}{%1$s}) {
35 return $self->{_relationship_data}{%1$s};
36 }
37 else {
38 my $relcond = $self->result_source->_resolve_relationship_condition(
39 rel_name => %1$s,
40 foreign_alias => %1$s,
41 self_alias => 'me',
42 self_result_object => $self,
43 );
44
45 return undef if (
46 $relcond->{join_free_condition}
47 and
48 $relcond->{join_free_condition} ne DBIx::Class::_Util::UNRESOLVABLE_CONDITION
49 and
50 scalar grep { not defined $_ } values %%{ $relcond->{join_free_condition} || {} }
51 and
52 $self->result_source->relationship_info(%1$s)->{attrs}{undef_on_null_fk}
53 );
54
55 my $val = $self->search_related( %1$s )->single;
56 return $val unless $val; # $val instead of undef so that null-objects can go through
57
58 return $self->{_relationship_data}{%1$s} = $val;
59 }
60EOC
61 }
62 elsif ($acc_type eq 'filter') {
63122189µs1221.72ms $class->throw_exception("No such column '$rel' to filter")
# spent 1.72ms making 122 calls to DBIx::Class::ResultSourceProxy::has_column, avg 14µs/call
64 unless $class->has_column($rel);
65
661221.49ms1222.07ms my $f_class = $class->relationship_info($rel)->{class};
# spent 2.07ms making 122 calls to DBIx::Class::ResultSourceProxy::relationship_info, avg 17µs/call
67
68 $class->inflate_column($rel, {
69 inflate => sub {
70 my ($val, $self) = @_;
71 return $self->find_or_new_related($rel, {}, {});
72 },
73 deflate => sub {
74 my ($val, $self) = @_;
75 $self->throw_exception("'$val' isn't a $f_class") unless $val->isa($f_class);
76
77 # MASSIVE FIXME - this code assumes we pointed at the PK, but the belongs_to
78 # helper does not check any of this
79 # fixup the code a bit to make things saner, but ideally 'filter' needs to
80 # be deprecated ASAP and removed shortly after
81 # Not doing so before 0.08250 however, too many things in motion already
82 my ($pk_col, @rest) = $val->result_source->_pri_cols_or_die;
83 $self->throw_exception(
84 "Relationship '$rel' of type 'filter' can not work with a multicolumn primary key on source '$f_class'"
85 ) if @rest;
86
87 my $pk_val = $val->get_column($pk_col);
88 carp_unique (
89 "Unable to deflate 'filter'-type relationship '$rel' (related object "
90 . "primary key not retrieved), assuming undef instead"
91 ) if ( ! defined $pk_val and $val->in_storage );
92
93 return $pk_val;
94 },
951222.27ms12243.0ms });
# spent 43.0ms making 122 calls to DBIx::Class::InflateColumn::inflate_column, avg 353µs/call
96 }
97 elsif ($acc_type eq 'multi') {
98
99144455µs14410.0ms quote_sub "${class}::${rel}_rs", "shift->search_related_rs( $rel => \@_ )";
# spent 10.0ms making 144 calls to Sub::Quote::quote_sub, avg 70µs/call
100144341µs1447.92ms quote_sub "${class}::add_to_${rel}", "shift->create_related( $rel => \@_ )";
# spent 7.92ms making 144 calls to Sub::Quote::quote_sub, avg 55µs/call
101144703µs28816.5ms quote_sub "${class}::${rel}", sprintf( <<'EOC', perlstring $rel );
# spent 16.2ms making 144 calls to Sub::Quote::quote_sub, avg 112µs/call # spent 307µs making 144 calls to DBIx::Class::_Util::perlstring, avg 2µs/call
102 DBIx::Class::_ENV_::ASSERT_NO_INTERNAL_WANTARRAY and my $sog = DBIx::Class::_Util::fail_on_internal_wantarray;
103 shift->search_related( %s => @_ )
104EOC
105 }
106 else {
107 $class->throw_exception("No such relationship accessor type '$acc_type'");
108 }
109
110}
111
11214µs1138µs1;
# spent 138µs making 1 call to B::Hooks::EndOfScope::XS::__ANON__