← Index
Performance Profile   « block view • line view • sub view »
For /wise/base/deliv/dev/bin/getfix
  Run on Thu May 20 15:30:03 2010
Reported on Thu May 20 16:25:45 2010

File/wise/base/static/lib/perl5/site_perl/5.10.0/DBIx/Class/Relationship/Accessor.pm
Statements Executed37
Total Time0.00074 seconds

Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
2116.5e-56.5e-5DBIx::Class::Relationship::Accessor::add_relationship_accessor
2116.3e-50.00021DBIx::Class::Relationship::Accessor::register_relationship
00000DBIx::Class::Relationship::Accessor::BEGIN
00000DBIx::Class::Relationship::Accessor::__ANON__[:31]
00000DBIx::Class::Relationship::Accessor::__ANON__[:40]
00000DBIx::Class::Relationship::Accessor::__ANON__[:46]
00000DBIx::Class::Relationship::Accessor::__ANON__[:50]
00000DBIx::Class::Relationship::Accessor::__ANON__[:51]
00000DBIx::Class::Relationship::Accessor::__ANON__[:52]

LineStmts.Exclusive
Time
Avg.Code
1package # hide from PAUSE
2 DBIx::Class::Relationship::Accessor;
3
434.5e-51.5e-5use strict;
# spent 10µs making 1 call to strict::import
530.000480.00016use warnings;
# spent 19µs making 1 call to warnings::import
6
7
# spent 209µs (63+146) within DBIx::Class::Relationship::Accessor::register_relationship which was called 2 times, avg 104µs/call: # 2 times (63µs+146µs) by DBIx::Class::ResultSourceProxy::add_relationship at line 96 of /wise/base/static/lib/perl5/site_perl/5.10.0/DBIx/Class/ResultSourceProxy.pm, avg 104µs/call
sub register_relationship {
825.0e-62.5e-6 my ($class, $rel, $info) = @_;
923.5e-51.7e-5 if (my $acc_type = $info->{attrs}{accessor}) {
# spent 65µs making 2 calls to DBIx::Class::Relationship::Accessor::add_relationship_accessor, avg 33µs/call
10 $class->add_relationship_accessor($rel => $acc_type);
11 }
1221.5e-57.5e-6 $class->next::method($rel => $info);
# spent 37µs making 2 calls to next::method, avg 18µs/call
13}
14
15
# spent 65µs within DBIx::Class::Relationship::Accessor::add_relationship_accessor which was called 2 times, avg 33µs/call: # 2 times (65µs+0) by DBIx::Class::Relationship::Accessor::register_relationship at line 9, avg 33µs/call
sub add_relationship_accessor {
1625.0e-62.5e-6 my ($class, $rel, $acc_type) = @_;
1721.0e-65.0e-7 my %meth;
1824.0e-62.0e-6 if ($acc_type eq 'single') {
19 $meth{$rel} = sub {
20 my $self = shift;
21 if (@_) {
22 $self->set_from_related($rel, @_);
23 return $self->{_relationship_data}{$rel} = $_[0];
24 } elsif (exists $self->{_relationship_data}{$rel}) {
25 return $self->{_relationship_data}{$rel};
26 } else {
27 my $val = $self->find_related($rel, {}, {});
28 return unless $val;
29 return $self->{_relationship_data}{$rel} = $val;
30 }
3116.0e-66.0e-6 };
32 } elsif ($acc_type eq 'filter') {
33 $class->throw_exception("No such column $rel to filter")
34 unless $class->has_column($rel);
35 my $f_class = $class->relationship_info($rel)->{class};
36 $class->inflate_column($rel,
37 { inflate => sub {
38 my ($val, $self) = @_;
39 return $self->find_or_create_related($rel, {}, {});
40 },
41 deflate => sub {
42 my ($val, $self) = @_;
43 $self->throw_exception("$val isn't a $f_class") unless $val->isa($f_class);
44 return ($val->_ident_values)[0];
45 # WARNING: probably breaks for multi-pri sometimes. FIXME
46 }
47 }
48 );
49 } elsif ($acc_type eq 'multi') {
5015.0e-65.0e-6 $meth{$rel} = sub { shift->search_related($rel, @_) };
5115.0e-65.0e-6 $meth{"${rel}_rs"} = sub { shift->search_related_rs($rel, @_) };
5214.0e-64.0e-6 $meth{"add_to_${rel}"} = sub { shift->create_related($rel, @_); };
53 } else {
54 $class->throw_exception("No such relationship accessor type $acc_type");
55 }
56 {
5753.6e-57.2e-6 no strict 'refs';
# spent 20µs making 1 call to strict::unimport
5837.2e-52.4e-5 no warnings 'redefine';
# spent 19µs making 1 call to warnings::unimport
5925.0e-62.5e-6 foreach my $meth (keys %meth) {
6041.7e-54.2e-6 *{"${class}::${meth}"} = $meth{$meth};
61 }
62 }
63}
64
6513.0e-63.0e-61;