← Index
NYTProf Performance Profile   « block view • line view • sub view »
For ddd2.pl
  Run on Tue May 25 16:52:24 2010
Reported on Tue May 25 16:56:45 2010

File /project/perl/lib/Class/DBI/Column.pm
Statements Executed 6662
Statement Execution Time 137ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
32923386.8ms130msClass::DBI::Column::::name_lcClass::DBI::Column::name_lc
1011655µs1.81msClass::DBI::Column::::newClass::DBI::Column::new
1011190µs190µsClass::DBI::Column::::add_groupClass::DBI::Column::add_group
522172µs172µsClass::DBI::Column::::groupsClass::DBI::Column::groups
411117µs254µsClass::DBI::Column::::in_databaseClass::DBI::Column::in_database
0000s0sClass::DBI::Column::::BEGINClass::DBI::Column::BEGIN
0000s0sClass::DBI::Column::::__ANON__[:37]Class::DBI::Column::__ANON__[:37]
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package Class::DBI::Column;
2
3=head1 NAME
4
5Class::DBI::Column - A column in a table
6
7=head1 SYNOPSIS
8
9 my $column = Class::DBI::Column->new($name);
10
11 my $name = $column->name;
12
13 my @groups = $column->groups;
14 my $pri_col = $colg->primary;
15
16 if ($column->in_database) { ... }
17
18=head1 DESCRIPTION
19
20Each Class::DBI class maintains a list of its columns as class data.
21This provides an interface to those columns. You probably shouldn't be
22dealing with this directly.
23
24=head1 METHODS
25
26=cut
27
28397µs126µsuse strict;
# spent 26µs making 1 call to strict::import
29393µs10suse base 'Class::Accessor::Fast';
# spent 2.05ms making 1 call to base::import, recursion: max depth 3, time 2.05ms
303185µs1248µsuse Carp;
# spent 248µs making 1 call to Exporter::import
31
32137µs11.12ms__PACKAGE__->mk_accessors(
# spent 1.12ms making 1 call to Class::Accessor::mk_accessors
33 qw/name accessor mutator placeholder is_constrained/
34);
35
36use overload
37327254.7ms3272129ms '""' => sub { shift->name_lc },
# spent 129ms making 3272 calls to Class::DBI::Column::name_lc, avg 39µs/call
3832.31ms1185µs fallback => 1;
# spent 185µs making 1 call to overload::import
39
40=head2 new
41
42 my $column = Class::DBI::Column->new($column)
43
44A new object for this column.
45
46=cut
47
48
# spent 1.81ms (655µs+1.16) within Class::DBI::Column::new which was called 10 times, avg 182µs/call: # 10 times (655µs+1.16ms) by Class::DBI::_set_columns at line 246 of Class/DBI.pm, avg 182µs/call
sub new {
4940642µs my $class = shift;
50 my $name = shift or croak "Column needs a name";
51 my $opt = shift || {};
52 return $class->SUPER::new(
# spent 1.16ms making 10 calls to Class::Accessor::new, avg 116µs/call
53 {
54 name => $name,
55 accessor => $name,
56 mutator => $name,
57 _groups => {},
58 placeholder => '?',
59 %$opt,
60 }
61 );
62}
63
64329278.2ms329242.9ms
# spent 130ms (86.8+42.9) within Class::DBI::Column::name_lc which was called 3292 times, avg 39µs/call: # 3272 times (86.2ms+42.6ms) by Class::DBI::ColumnGrouper::_uniq or Class::DBI::ColumnGrouper::add_column or Class::DBI::ColumnGrouper::find_column or Class::DBI::Relationship::HasA::remap_arguments or Class::DBI::Relationship::HasA::triggers or Class::DBI::SQL::Transformer::_do_transformation or Class::DBI::_attribute_exists or Class::DBI::_attribute_store or Class::DBI::_attrs or Class::DBI::_extend_class_data or Class::DBI::_extend_meta or Class::DBI::_flesh or Class::DBI::_live_object_key or Class::DBI::_make_method or Class::DBI::meta_info at line 37, avg 39µs/call # 10 times (260µs+136µs) by Class::DBI::ColumnGrouper::add_column at line 85 of Class/DBI/ColumnGrouper.pm, avg 40µs/call # 10 times (270µs+125µs) by Class::DBI::_mk_column_accessors at line 359 of Class/DBI.pm, avg 40µs/call
sub name_lc { lc shift->name }
# spent 42.9ms making 3292 calls to Class::Accessor::Fast::__ANON__[Class/Accessor/Fast.pm:41], avg 13µs/call
65
66
# spent 190µs within Class::DBI::Column::add_group which was called 10 times, avg 19µs/call: # 10 times (190µs+0s) by Class::DBI::ColumnGrouper::add_group at line 113 of Class/DBI/ColumnGrouper.pm, avg 19µs/call
sub add_group {
6720210µs my ($self, $group) = @_;
68 $self->{_groups}->{$group} = 1;
69}
70
71
# spent 172µs within Class::DBI::Column::groups which was called 5 times, avg 34µs/call: # 4 times (137µs+0s) by Class::DBI::Column::in_database at line 79, avg 34µs/call # once (35µs+0s) by Class::DBI::ColumnGrouper::groups_for at line 136 of Class/DBI/ColumnGrouper.pm
sub groups {
7220188µs my $self = shift;
73 my %groups = %{ $self->{_groups} };
74 delete $groups{All} if keys %groups > 1;
75 return keys %groups;
76}
77
78
# spent 254µs (117+137) within Class::DBI::Column::in_database which was called 4 times, avg 64µs/call: # 4 times (117µs+137µs) by Class::DBI::ColumnGrouper::all_columns at line 174 of Class/DBI/ColumnGrouper.pm, avg 64µs/call
sub in_database {
794115µs4137µs return !scalar grep $_ eq "TEMP", shift->groups;
# spent 137µs making 4 calls to Class::DBI::Column::groups, avg 34µs/call
80}
81
82116µs1;