← Index
NYTProf Performance Profile   « block view • line view • sub view »
For xt/tapper-mcp-scheduler-with-db-longrun.t
  Run on Tue May 22 17:18:39 2012
Reported on Tue May 22 17:23:01 2012

Filename/2home/ss5/perl5/perlbrew/perls/perl-5.12.3/lib/site_perl/5.12.3/DBIx/Class/Relationship/Accessor.pm
StatementsExecuted 20877 statements in 119ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
60111.67ms2.59msDBIx::Class::Relationship::Accessor::::add_relationship_accessorDBIx::Class::Relationship::Accessor::add_relationship_accessor
6011805µs4.75msDBIx::Class::Relationship::Accessor::::register_relationshipDBIx::Class::Relationship::Accessor::register_relationship
11114µs18µsDBIx::Class::Relationship::Accessor::::BEGIN@4DBIx::Class::Relationship::Accessor::BEGIN@4
1118µs23µsDBIx::Class::Relationship::Accessor::::BEGIN@5DBIx::Class::Relationship::Accessor::BEGIN@5
1118µs22µsDBIx::Class::Relationship::Accessor::::BEGIN@72DBIx::Class::Relationship::Accessor::BEGIN@72
1118µs21µsDBIx::Class::Relationship::Accessor::::BEGIN@73DBIx::Class::Relationship::Accessor::BEGIN@73
1114µs4µsDBIx::Class::Relationship::Accessor::::BEGIN@6DBIx::Class::Relationship::Accessor::BEGIN@6
0000s0sDBIx::Class::Relationship::Accessor::::__ANON__[:46]DBIx::Class::Relationship::Accessor::__ANON__[:46]
0000s0sDBIx::Class::Relationship::Accessor::::__ANON__[:55]DBIx::Class::Relationship::Accessor::__ANON__[:55]
0000s0sDBIx::Class::Relationship::Accessor::::__ANON__[:61]DBIx::Class::Relationship::Accessor::__ANON__[:61]
0000s0sDBIx::Class::Relationship::Accessor::::__ANON__[:65]DBIx::Class::Relationship::Accessor::__ANON__[:65]
0000s0sDBIx::Class::Relationship::Accessor::::__ANON__[:66]DBIx::Class::Relationship::Accessor::__ANON__[:66]
0000s0sDBIx::Class::Relationship::Accessor::::__ANON__[:67]DBIx::Class::Relationship::Accessor::__ANON__[:67]
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
4324µs221µs
# spent 18µs (14+4) within DBIx::Class::Relationship::Accessor::BEGIN@4 which was called: # once (14µs+4µs) by Class::C3::Componentised::ensure_class_loaded at line 4
use strict;
# spent 18µs making 1 call to DBIx::Class::Relationship::Accessor::BEGIN@4 # spent 4µs making 1 call to strict::import
5319µs237µs
# spent 23µs (8+14) within DBIx::Class::Relationship::Accessor::BEGIN@5 which was called: # once (8µs+14µs) by Class::C3::Componentised::ensure_class_loaded at line 5
use warnings;
# spent 23µs making 1 call to DBIx::Class::Relationship::Accessor::BEGIN@5 # spent 14µs making 1 call to warnings::import
63406µs14µs
# spent 4µs within DBIx::Class::Relationship::Accessor::BEGIN@6 which was called: # once (4µs+0s) by Class::C3::Componentised::ensure_class_loaded at line 6
use Sub::Name ();
# spent 4µs making 1 call to DBIx::Class::Relationship::Accessor::BEGIN@6
7
812µsour %_pod_inherit_config =
9 (
10 class_map => { 'DBIx::Class::Relationship::Accessor' => 'DBIx::Class::Relationship' }
11 );
12
13
# spent 4.75ms (805µs+3.94) within DBIx::Class::Relationship::Accessor::register_relationship which was called 60 times, avg 79µs/call: # 60 times (805µs+3.94ms) by DBIx::Class::ResultSourceProxy::add_relationship at line 45 of DBIx/Class/ResultSourceProxy.pm, avg 79µs/call
sub register_relationship {
14180626µs my ($class, $rel, $info) = @_;
15602.59ms if (my $acc_type = $info->{attrs}{accessor}) {
# spent 2.59ms making 60 calls to DBIx::Class::Relationship::Accessor::add_relationship_accessor, avg 43µs/call
16 $class->add_relationship_accessor($rel => $acc_type);
17 }
1860506µs $class->next::method($rel => $info);
# spent 506µs making 60 calls to next::method, avg 8µs/call
19}
20
21
# spent 2.59ms (1.67+922µs) within DBIx::Class::Relationship::Accessor::add_relationship_accessor which was called 60 times, avg 43µs/call: # 60 times (1.67ms+922µs) by DBIx::Class::Relationship::Accessor::register_relationship at line 15, avg 43µs/call
sub add_relationship_accessor {
22240291µs my ($class, $rel, $acc_type) = @_;
23 my %meth;
24144696µs if ($acc_type eq 'single') {
2536641µs my $rel_info = $class->relationship_info($rel);
# spent 641µs making 36 calls to DBIx::Class::ResultSourceProxy::relationship_info, avg 18µs/call
26 $meth{$rel} = sub {
27612618.0ms my $self = shift;
28782968.5ms if (@_) {
29 $self->set_from_related($rel, @_);
30 return $self->{_relationship_data}{$rel} = $_[0];
31 } elsif (exists $self->{_relationship_data}{$rel}) {
32 return $self->{_relationship_data}{$rel};
33 } else {
343308105ms my $cond = $self->result_source->_resolve_condition(
# spent 97.4ms making 1654 calls to DBIx::Class::ResultSource::_resolve_condition, avg 59µs/call # spent 7.28ms making 1654 calls to DBIx::Class::Row::result_source, avg 4µs/call
35 $rel_info->{cond}, $rel, $self, $rel
36 );
3724263.45ms if ($rel_info->{attrs}->{undef_on_null_fk}){
38 return undef unless ref($cond) eq 'HASH';
39 return undef if grep { not defined $_ } values %$cond;
40 }
4116545.20s my $val = $self->find_related($rel, {}, {});
# spent 5.20s making 1654 calls to DBIx::Class::Relationship::Base::find_related, avg 3.14ms/call
42 return $val unless $val; # $val instead of undef so that null-objects can go through
43
44 return $self->{_relationship_data}{$rel} = $val;
45 }
46 };
47 } elsif ($acc_type eq 'filter') {
48 $class->throw_exception("No such column $rel to filter")
49 unless $class->has_column($rel);
50 my $f_class = $class->relationship_info($rel)->{class};
51 $class->inflate_column($rel,
52 { inflate => sub {
53 my ($val, $self) = @_;
54 return $self->find_or_new_related($rel, {}, {});
55 },
56 deflate => sub {
57 my ($val, $self) = @_;
58 $self->throw_exception("$val isn't a $f_class") unless $val->isa($f_class);
59 return ($val->_ident_values)[0];
60 # WARNING: probably breaks for multi-pri sometimes. FIXME
61 }
62 }
63 );
64 } elsif ($acc_type eq 'multi') {
65363926.3ms36392.39s $meth{$rel} = sub { shift->search_related($rel, @_) };
# spent 2.39s making 3639 calls to DBIx::Class::Relationship::Base::search_related, avg 658µs/call
66 $meth{"${rel}_rs"} = sub { shift->search_related_rs($rel, @_) };
67 $meth{"add_to_${rel}"} = sub { shift->create_related($rel, @_); };
68 } else {
69 $class->throw_exception("No such relationship accessor type $acc_type");
70 }
71 {
72324µs236µs
# spent 22µs (8+14) within DBIx::Class::Relationship::Accessor::BEGIN@72 which was called: # once (8µs+14µs) by Class::C3::Componentised::ensure_class_loaded at line 72
no strict 'refs';
# spent 22µs making 1 call to DBIx::Class::Relationship::Accessor::BEGIN@72 # spent 14µs making 1 call to strict::unimport
73377µs234µs
# spent 21µs (8+13) within DBIx::Class::Relationship::Accessor::BEGIN@73 which was called: # once (8µs+13µs) by Class::C3::Componentised::ensure_class_loaded at line 73
no warnings 'redefine';
# spent 21µs making 1 call to DBIx::Class::Relationship::Accessor::BEGIN@73 # spent 13µs making 1 call to warnings::unimport
746096µs foreach my $meth (keys %meth) {
75216889µs my $name = join '::', $class, $meth;
76108281µs *$name = Sub::Name::subname($name, $meth{$meth});
# spent 281µs making 108 calls to Sub::Name::subname, avg 3µs/call
77 }
78 }
79}
80
8113µs1;