← Index
NYTProf Performance Profile   « block view • line view • sub view »
For /usr/share/koha/opac/cgi-bin/opac/opac-search.pl
  Run on Tue Oct 15 11:58:52 2013
Reported on Tue Oct 15 12:01:06 2013

Filename/usr/share/perl5/DateTime/Format/MySQL.pm
StatementsExecuted 14 statements in 864µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1114.32ms14.2msDateTime::Format::MySQL::::BEGIN@11DateTime::Format::MySQL::BEGIN@11
11118µs23µsDateTime::Format::MySQL::::BEGIN@3DateTime::Format::MySQL::BEGIN@3
101115µs15µsDateTime::Format::MySQL::::CORE:qrDateTime::Format::MySQL::CORE:qr (opcode)
1119µs34µsDateTime::Format::MySQL::::BEGIN@5DateTime::Format::MySQL::BEGIN@5
1117µs7µsDateTime::Format::MySQL::::BEGIN@9DateTime::Format::MySQL::BEGIN@9
0000s0sDateTime::Format::MySQL::::_fix_2_digit_yearDateTime::Format::MySQL::_fix_2_digit_year
0000s0sDateTime::Format::MySQL::::format_dateDateTime::Format::MySQL::format_date
0000s0sDateTime::Format::MySQL::::format_datetimeDateTime::Format::MySQL::format_datetime
0000s0sDateTime::Format::MySQL::::format_timeDateTime::Format::MySQL::format_time
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package DateTime::Format::MySQL;
2
3332µs227µs
# spent 23µs (18+4) within DateTime::Format::MySQL::BEGIN@3 which was called: # once (18µs+4µs) by C4::Koha::BEGIN@30 at line 3
use strict;
# spent 23µs making 1 call to DateTime::Format::MySQL::BEGIN@3 # spent 4µs making 1 call to strict::import
4
5337µs260µs
# spent 34µs (9+25) within DateTime::Format::MySQL::BEGIN@5 which was called: # once (9µs+25µs) by C4::Koha::BEGIN@30 at line 5
use vars qw ($VERSION);
# spent 34µs making 1 call to DateTime::Format::MySQL::BEGIN@5 # spent 25µs making 1 call to vars::import
6
711µs$VERSION = '0.04';
8
93380µs17µs
# spent 7µs within DateTime::Format::MySQL::BEGIN@9 which was called: # once (7µs+0s) by C4::Koha::BEGIN@30 at line 9
use DateTime;
# spent 7µs making 1 call to DateTime::Format::MySQL::BEGIN@9
10use DateTime::Format::Builder
11114.01ms
# spent 14.2ms (4.32+9.92) within DateTime::Format::MySQL::BEGIN@11 which was called: # once (4.32ms+9.92ms) by C4::Koha::BEGIN@30 at line 71
( parsers =>
# spent 3.99ms making 1 call to DateTime::Format::Builder::import # spent 15µs making 10 calls to DateTime::Format::MySQL::CORE:qr, avg 2µs/call
12 { parse_date =>
13 { params => [ qw( year month day ) ],
14 regex => qr/^(\d{1,4})-(\d\d)-(\d\d)$/,
15 },
16
17 parse_datetime =>
18 { params => [ qw( year month day hour minute second ) ],
19 regex => qr/^(\d{1,4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)$/,
20 extra => { time_zone => 'floating' },
21 },
22
23 parse_timestamp =>
24 [ { length => 14,
25 params => [ qw( year month day hour minute second ) ],
26 regex => qr/^(\d\d\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/,
27 extra => { time_zone => 'floating' },
28 },
29 {
30 params => [ qw( year month day hour minute second ) ],
31 regex => qr/^(\d{1,4})-(\d\d)-(\d\d) (\d\d):(\d\d):(\d\d)$/,
32 extra => { time_zone => 'floating'},
33 },
34 { length => 12,
35 params => [ qw( year month day hour minute second ) ],
36 regex => qr/^(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/,
37 extra => { time_zone => 'floating' },
38 postprocess => \&_fix_2_digit_year,
39 },
40 { length => 10,
41 params => [ qw( year month day hour minute ) ],
42 regex => qr/^(\d\d)(\d\d)(\d\d)(\d\d)(\d\d)$/,
43 extra => { time_zone => 'floating' },
44 postprocess => \&_fix_2_digit_year,
45 },
46 { length => 8,
47 params => [ qw( year month day ) ],
48 regex => qr/^(\d\d\d\d)(\d\d)(\d\d)$/,
49 extra => { time_zone => 'floating' },
50 },
51 { length => 6,
52 params => [ qw( year month day ) ],
53 regex => qr/^(\d\d)(\d\d)(\d\d)$/,
54 extra => { time_zone => 'floating' },
55 postprocess => \&_fix_2_digit_year,
56 },
57 { length => 4,
58 params => [ qw( year month ) ],
59 regex => qr/^(\d\d)(\d\d)$/,
60 extra => { time_zone => 'floating' },
61 postprocess => \&_fix_2_digit_year,
62 },
63 { length => 2,
64 params => [ qw( year ) ],
65 regex => qr/^(\d\d)$/,
66 extra => { time_zone => 'floating' },
67 postprocess => \&_fix_2_digit_year,
68 },
69 ],
70 },
713409µs114.2ms );
# spent 14.2ms making 1 call to DateTime::Format::MySQL::BEGIN@11
72
73sub _fix_2_digit_year
74{
75 my %p = @_;
76
77 $p{parsed}{year} += $p{parsed}{year} <= 69 ? 2000 : 1900;
78}
79
80sub format_date
81{
82 my ( $self, $dt ) = @_;
83
84 return $dt->ymd('-');
85}
86
87sub format_time
88{
89 my ( $self, $dt ) = @_;
90
91 return $dt->hms(':');
92}
93
94sub format_datetime
95{
96 my ( $self, $dt ) = @_;
97
98 return $self->format_date($dt) . ' ' . $self->format_time($dt);
99}
100
101
10214µs1;
103
104__END__
 
# spent 15µs within DateTime::Format::MySQL::CORE:qr which was called 10 times, avg 2µs/call: # 10 times (15µs+0s) by DateTime::Format::MySQL::BEGIN@11 at line 11, avg 2µs/call
sub DateTime::Format::MySQL::CORE:qr; # opcode