← Index
NYTProf Performance Profile   « block view • line view • sub view »
For mentat.storage.mongo.pl
  Run on Tue Jun 24 09:58:41 2014
Reported on Tue Jun 24 09:59:12 2014

Filename/usr/local/share/perl/5.14.2/DateTime/TimeZone/OlsonDB/Rule.pm
StatementsExecuted 16 statements in 1.25ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11119µs19µsDateTime::TimeZone::OlsonDB::Rule::::BEGIN@5DateTime::TimeZone::OlsonDB::Rule::BEGIN@5
11118µs18µsDateTime::TimeZone::OlsonDB::Rule::::BEGIN@13DateTime::TimeZone::OlsonDB::Rule::BEGIN@13
11118µs18µsDateTime::TimeZone::OlsonDB::Rule::::BEGIN@14DateTime::TimeZone::OlsonDB::Rule::BEGIN@14
11117µs90µsDateTime::TimeZone::OlsonDB::Rule::::BEGIN@16DateTime::TimeZone::OlsonDB::Rule::BEGIN@16
11115µs21µsDateTime::TimeZone::OlsonDB::Rule::::BEGIN@9DateTime::TimeZone::OlsonDB::Rule::BEGIN@9
11114µs25µsDateTime::TimeZone::OlsonDB::Rule::::BEGIN@10DateTime::TimeZone::OlsonDB::Rule::BEGIN@10
11112µs12µsDateTime::TimeZone::OlsonDB::Rule::::BEGIN@12DateTime::TimeZone::OlsonDB::Rule::BEGIN@12
0000s0sDateTime::TimeZone::OlsonDB::Rule::::atDateTime::TimeZone::OlsonDB::Rule::at
0000s0sDateTime::TimeZone::OlsonDB::Rule::::is_infiniteDateTime::TimeZone::OlsonDB::Rule::is_infinite
0000s0sDateTime::TimeZone::OlsonDB::Rule::::letterDateTime::TimeZone::OlsonDB::Rule::letter
0000s0sDateTime::TimeZone::OlsonDB::Rule::::max_yearDateTime::TimeZone::OlsonDB::Rule::max_year
0000s0sDateTime::TimeZone::OlsonDB::Rule::::min_yearDateTime::TimeZone::OlsonDB::Rule::min_year
0000s0sDateTime::TimeZone::OlsonDB::Rule::::monthDateTime::TimeZone::OlsonDB::Rule::month
0000s0sDateTime::TimeZone::OlsonDB::Rule::::nameDateTime::TimeZone::OlsonDB::Rule::name
0000s0sDateTime::TimeZone::OlsonDB::Rule::::newDateTime::TimeZone::OlsonDB::Rule::new
0000s0sDateTime::TimeZone::OlsonDB::Rule::::offset_from_stdDateTime::TimeZone::OlsonDB::Rule::offset_from_std
0000s0sDateTime::TimeZone::OlsonDB::Rule::::onDateTime::TimeZone::OlsonDB::Rule::on
0000s0sDateTime::TimeZone::OlsonDB::Rule::::utc_start_datetime_for_yearDateTime::TimeZone::OlsonDB::Rule::utc_start_datetime_for_year
Call graph for these subroutines as a Graphviz dot language file.
Line State
ments
Time
on line
Calls Time
in subs
Code
1package DateTime::TimeZone::OlsonDB::Rule;
2{
323µs $DateTime::TimeZone::OlsonDB::Rule::VERSION = '1.63';
4}
5
# spent 19µs within DateTime::TimeZone::OlsonDB::Rule::BEGIN@5 which was called: # once (19µs+0s) by DateTime::TimeZone::OlsonDB::BEGIN@14 at line 7
BEGIN {
6111µs $DateTime::TimeZone::OlsonDB::Rule::AUTHORITY = 'cpan:DROLSKY';
7143µs119µs}
# spent 19µs making 1 call to DateTime::TimeZone::OlsonDB::Rule::BEGIN@5
8
9247µs228µs
# spent 21µs (15+6) within DateTime::TimeZone::OlsonDB::Rule::BEGIN@9 which was called: # once (15µs+6µs) by DateTime::TimeZone::OlsonDB::BEGIN@14 at line 9
use strict;
# spent 21µs making 1 call to DateTime::TimeZone::OlsonDB::Rule::BEGIN@9 # spent 6µs making 1 call to strict::import
10246µs236µs
# spent 25µs (14+11) within DateTime::TimeZone::OlsonDB::Rule::BEGIN@10 which was called: # once (14µs+11µs) by DateTime::TimeZone::OlsonDB::BEGIN@14 at line 10
use warnings;
# spent 25µs making 1 call to DateTime::TimeZone::OlsonDB::Rule::BEGIN@10 # spent 11µs making 1 call to warnings::import
11
12255µs112µs
# spent 12µs within DateTime::TimeZone::OlsonDB::Rule::BEGIN@12 which was called: # once (12µs+0s) by DateTime::TimeZone::OlsonDB::BEGIN@14 at line 12
use DateTime;
# spent 12µs making 1 call to DateTime::TimeZone::OlsonDB::Rule::BEGIN@12
13256µs118µs
# spent 18µs within DateTime::TimeZone::OlsonDB::Rule::BEGIN@13 which was called: # once (18µs+0s) by DateTime::TimeZone::OlsonDB::BEGIN@14 at line 13
use DateTime::Duration;
# spent 18µs making 1 call to DateTime::TimeZone::OlsonDB::Rule::BEGIN@13
14264µs118µs
# spent 18µs within DateTime::TimeZone::OlsonDB::Rule::BEGIN@14 which was called: # once (18µs+0s) by DateTime::TimeZone::OlsonDB::BEGIN@14 at line 14
use DateTime::TimeZone::OlsonDB;
# spent 18µs making 1 call to DateTime::TimeZone::OlsonDB::Rule::BEGIN@14
15
162924µs2163µs
# spent 90µs (17+73) within DateTime::TimeZone::OlsonDB::Rule::BEGIN@16 which was called: # once (17µs+73µs) by DateTime::TimeZone::OlsonDB::BEGIN@14 at line 16
use Params::Validate qw( validate SCALAR );
# spent 90µs making 1 call to DateTime::TimeZone::OlsonDB::Rule::BEGIN@16 # spent 73µs making 1 call to Exporter::import
17
18sub new {
19 my $class = shift;
20 my %p = validate(
21 @_, {
22 name => { type => SCALAR },
23 from => { type => SCALAR },
24 to => { type => SCALAR },
25 type => { type => SCALAR, default => undef },
26 in => { type => SCALAR },
27 on => { type => SCALAR },
28 at => { type => SCALAR },
29 save => { type => SCALAR },
30 letter => { type => SCALAR, default => '' },
31 },
32 );
33
34 my $save = $p{save};
35
36 # The handling of q{-} and q{1} are to account for new syntax introduced
37 # in 2009u (and hopefully gone in future versions).
38 if ( $save && $save ne q{-} ) {
39 if ( $save =~ /^\d+$/ ) {
40 $p{offset_from_std} = 3600 * $save;
41 }
42 else {
43 $p{offset_from_std}
44 = DateTime::TimeZone::offset_as_seconds($save);
45 }
46 }
47 else {
48 $p{offset_from_std} = 0;
49 }
50
51 return bless \%p, $class;
52}
53
54sub name { $_[0]->{name} }
55sub offset_from_std { $_[0]->{offset_from_std} }
56sub letter { $_[0]->{letter} }
57sub min_year { $_[0]->{from} }
58
59sub max_year {
60 $_[0]->{to} eq 'only' ? $_[0]->min_year
61 : $_[0]->{to} eq 'max' ? undef
62 : $_[0]->{to};
63}
64
65sub is_infinite { $_[0]->{to} eq 'max' ? 1 : 0 }
66
67sub month { $DateTime::TimeZone::OlsonDB::MONTHS{ $_[0]->{in} } }
68sub on { $_[0]->{on} }
69sub at { $_[0]->{at} }
70
71sub utc_start_datetime_for_year {
72 my $self = shift;
73 my $year = shift;
74 my $offset_from_utc = shift;
75
76 # should be the offset of the _previous_ rule
77 my $offset_from_std = shift;
78
79 my $day = DateTime::TimeZone::OlsonDB::parse_day_spec( $self->on,
80 $self->month, $year );
81
82 my $utc = DateTime::TimeZone::OlsonDB::utc_datetime_for_time_spec(
83 spec => $self->at,
84 year => $year,
85 month => $self->month,
86 day => $day,
87 offset_from_utc => $offset_from_utc,
88 offset_from_std => $offset_from_std,
89 );
90
91 return $utc;
92}
93
9416µs1;