← 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:41 2010

File/wise/base/static/lib/perl5/site_perl/5.10.0/DBIx/Class/Relationship/HasMany.pm
Statements Executed23
Total Time0.000483 seconds

Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1110.000140.01395DBIx::Class::Relationship::HasMany::has_many
00000DBIx::Class::Relationship::HasMany::BEGIN

LineStmts.Exclusive
Time
Avg.Code
1package # hide from PAUSE
2 DBIx::Class::Relationship::HasMany;
3
433.3e-51.1e-5use strict;
# spent 11µs making 1 call to strict::import
530.000289.5e-5use warnings;
# spent 22µs making 1 call to warnings::import
6
7
# spent 13.9ms (141µs+13.8) within DBIx::Class::Relationship::HasMany::has_many which was called # once (141µs+13.8ms) at line 44 of /wise/base/deliv/dev/lib/perl/WISE/DB/FrameIndex/Scan.pm
sub has_many {
813.0e-63.0e-6 my ($class, $rel, $f_class, $cond, $attrs) = @_;
9
1011.0e-61.0e-6 unless (ref $cond) {
1112.6e-52.6e-5 $class->ensure_class_loaded($f_class);
# spent 13.4ms making 1 call to Class::C3::Componentised::ensure_class_loaded, max recursion depth 1
1212.8e-52.8e-5 my ($pri, $too_many) = $class->primary_columns;
# spent 79µs making 1 call to DBIx::Class::ResultSourceProxy::primary_columns
13
1411.0e-61.0e-6 $class->throw_exception(
15 "has_many can only infer join for a single primary key; ".
16 "${class} has more"
17 ) if $too_many;
18
1911.0e-61.0e-6 $class->throw_exception(
20 "has_many needs a primary key to infer a join; ".
21 "${class} has none"
22 ) if !defined $pri && (!defined $cond || !length $cond);
23
2411.0e-61.0e-6 my ($f_key,$guess);
2512.0e-62.0e-6 if (defined $cond && length $cond) {
26 $f_key = $cond;
27 $guess = "caller specified foreign key '$f_key'";
28 } else {
2918.0e-68.0e-6 $class =~ /([^\:]+)$/;
3015.0e-65.0e-6 $f_key = lc $1; # go ahead and guess; best we can do
3113.0e-63.0e-6 $guess = "using our class name '$class' as foreign key";
32 }
33
3422.8e-51.4e-5 my $f_class_loaded = eval { $f_class->columns };
# spent 79µs making 1 call to DBIx::Class::ResultSourceProxy::columns
3512.5e-52.5e-5 $class->throw_exception(
# spent 63µs making 1 call to DBIx::Class::ResultSourceProxy::has_column
36 "No such column ${f_key} on foreign class ${f_class} ($guess)"
37 ) if $f_class_loaded && !$f_class->has_column($f_key);
38
3913.0e-63.0e-6 $cond = { "foreign.${f_key}" => "self.${pri}" };
40 }
41
42 $class->add_relationship($rel, $f_class, $cond, {
43 accessor => 'multi',
44 join_type => 'LEFT',
45 cascade_delete => 1,
46 cascade_copy => 1,
4712.8e-52.8e-5 %{$attrs||{}}
# spent 206µs making 1 call to DBIx::Class::ResultSourceProxy::add_relationship
48 });
49}
50
5113.0e-63.0e-61;