← 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 17:10:45 2013
Reported on Tue Oct 15 17:12:39 2013

Filename/usr/share/perl5/DateTime/Format/MySQL.pm
StatementsExecuted 14 statements in 927µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1114.60ms14.9msDateTime::Format::MySQL::::BEGIN@11DateTime::Format::MySQL::BEGIN@11
101174µs74µsDateTime::Format::MySQL::::CORE:qrDateTime::Format::MySQL::CORE:qr (opcode)
11117µs21µsDateTime::Format::MySQL::::BEGIN@3DateTime::Format::MySQL::BEGIN@3
11115µs48µsDateTime::Format::MySQL::::BEGIN@5DateTime::Format::MySQL::BEGIN@5
11112µs14µ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
3342µs225µs
# spent 21µs (17+4) within DateTime::Format::MySQL::BEGIN@3 which was called: # once (17µs+4µs) by C4::Koha::BEGIN@30 at line 3
use strict;
# spent 21µs making 1 call to DateTime::Format::MySQL::BEGIN@3 # spent 4µs making 1 call to strict::import
4
5342µs280µs
# spent 48µs (15+33) within DateTime::Format::MySQL::BEGIN@5 which was called: # once (15µs+33µs) by C4::Koha::BEGIN@30 at line 5
use vars qw ($VERSION);
# spent 48µs making 1 call to DateTime::Format::MySQL::BEGIN@5 # spent 33µs making 1 call to vars::import
6
711µs$VERSION = '0.04';
8
93310µs216µs
# spent 14µs (12+2) within DateTime::Format::MySQL::BEGIN@9 which was called: # once (12µs+2µs) by C4::Koha::BEGIN@30 at line 9
use DateTime;
# spent 14µs making 1 call to DateTime::Format::MySQL::BEGIN@9 # spent 2µs making 1 call to UNIVERSAL::import
10use DateTime::Format::Builder
111187µs114.06ms
# spent 14.9ms (4.60+10.3) within DateTime::Format::MySQL::BEGIN@11 which was called: # once (4.60ms+10.3ms) by C4::Koha::BEGIN@30 at line 71
( parsers =>
# spent 3.99ms making 1 call to DateTime::Format::Builder::import # spent 74µs making 10 calls to DateTime::Format::MySQL::CORE:qr, avg 7µ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 },
712342µs114.9ms );
# spent 14.9ms 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 74µs within DateTime::Format::MySQL::CORE:qr which was called 10 times, avg 7µs/call: # 10 times (74µs+0s) by DateTime::Format::MySQL::BEGIN@11 at line 11, avg 7µs/call
sub DateTime::Format::MySQL::CORE:qr; # opcode