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

File /project/perllib/K2/DB2.pm
Statements Executed 31
Statement Execution Time 40.9ms
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
111170µs2.46msK2::DB2::::__ANON__[:49]K2::DB2::__ANON__[:49]
11170µs114msK2::DB2::::has_a_datetimeK2::DB2::has_a_datetime
0000s0sK2::DB2::::BEGINK2::DB2::BEGIN
0000s0sK2::DB2::::do_transactionK2::DB2::do_transaction
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package K2::DB2;
23105µs10suse base qw(Class::DBI::Pg);
# spent 289ms making 1 call to base::import, recursion: max depth 1, time 289ms
3
4377µs121µsuse strict;
# spent 21µs making 1 call to strict::import
53106µs1111µsuse warnings;
# spent 111µs making 1 call to warnings::import
6395µs1334µsuse Carp qw(cluck);
# spent 334µs making 1 call to Exporter::import
73689µs1196µsuse Class::DBI::AbstractSearch;
# spent 196µs making 1 call to Exporter::import
838.05ms1826µsuse Class::DBI::Plugin::RetrieveAll;
# spent 826µs making 1 call to Class::DBI::Plugin::RetrieveAll::import
9318.1ms1907µsuse Class::DBI::Plugin::AbstractCount;
# spent 907µs making 1 call to Class::DBI::Plugin::import
10313.5ms1160µsuse Class::DBI::Plugin::Pager;
# spent 160µs making 1 call to Class::DBI::Plugin::Pager::import
11
12
13144µs11.07ms__PACKAGE__->connection('dbi:Pg:dbname=k2',
# spent 1.07ms making 1 call to Class::DBI::connection
14 'koumei2',
15 '',
16 { PrintWarn => 1,
17 # PrintError => 1,
18 RaiseError => 1,
19 ShowErrorStatement => 1,
20 AutoCommit => 1,
21 },);
22
23
24sub do_transaction {
25 my $class = shift;
26 my ( $code ) = @_;
27 local $class->db_Main->{ AutoCommit };
28
29 eval { $code->() };
30 if ( $@ ) {
31 my $commit_error = $@;
32 eval { $class->dbi_rollback };
33 cluck $commit_error;
34 return undef;
35 }
36 return 1;
37}
38
39
40
# spent 114ms (70µs+114) within K2::DB2::has_a_datetime which was called # once (70µs+114ms) by main::BEGIN at line 7 of Wiki/DB/Wiki.pm
sub has_a_datetime {
41373µs my ($class, @column) = @_;
42
43 for my $column (@column) {
44 $class->has_a(
45 $column => 'Class::Date',
46
# spent 2.46ms (170µs+2.29) within K2::DB2::__ANON__[/project/perllib/K2/DB2.pm:49] which was called # once (170µs+2.29ms) by Class::DBI::Relationship::HasA::__ANON__[/project/perl/lib/Class/DBI/Relationship/HasA.pm:50] at line 45 of Class/DBI/Relationship/HasA.pm
inflate => sub {
47237µs my ($datetime, $obj) = @_;
48 return Class::Date::date($datetime);
# spent 2.29ms making 1 call to Class::Date::date
49 },
50 deflate => 'string',
# spent 114ms making 1 call to Class::DBI::__ANON__[Class/DBI.pm:1034]
51 );
52 }
53}
54
55
56121µs1;