← 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:31 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 {
833.2e-51.1e-5 my ($class, $rel, $f_class, $cond, $attrs) = @_;
9
1098.9e-59.9e-6 unless (ref $cond) {
11 $class->ensure_class_loaded($f_class);
# spent 13.4ms making 1 call to Class::C3::Componentised::ensure_class_loaded, max recursion depth 1
12 my ($pri, $too_many) = $class->primary_columns;
# spent 79µs making 1 call to DBIx::Class::ResultSourceProxy::primary_columns
13
14 $class->throw_exception(
15 "has_many can only infer join for a single primary key; ".
16 "${class} has more"
17 ) if $too_many;
18
19 $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
24 my ($f_key,$guess);
2531.6e-55.3e-6 if (defined $cond && length $cond) {
26 $f_key = $cond;
27 $guess = "caller specified foreign key '$f_key'";
28 } else {
29 $class =~ /([^\:]+)$/;
30 $f_key = lc $1; # go ahead and guess; best we can do
31 $guess = "using our class name '$class' as foreign key";
32 }
33
3412.6e-52.6e-5 my $f_class_loaded = eval { $f_class->columns };
# spent 79µs making 1 call to DBIx::Class::ResultSourceProxy::columns
35 $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
39 $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,
47 %{$attrs||{}}
# spent 206µs making 1 call to DBIx::Class::ResultSourceProxy::add_relationship
48 });
49}
50
5113.0e-63.0e-61;