← Index
NYTProf Performance Profile   « block view • line view • sub view »
For mentat.storage.mongo.pl
  Run on Tue Jun 24 10:04:38 2014
Reported on Tue Jun 24 10:05:06 2014

Filename/usr/local/share/perl/5.14.2/DateTime/TimeZone/OlsonDB/Rule.pm
StatementsExecuted 16 statements in 557µs
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
1119µs9µsDateTime::TimeZone::OlsonDB::Rule::::BEGIN@5DateTime::TimeZone::OlsonDB::Rule::BEGIN@5
1119µs43µsDateTime::TimeZone::OlsonDB::Rule::::BEGIN@16DateTime::TimeZone::OlsonDB::Rule::BEGIN@16
1119µs9µsDateTime::TimeZone::OlsonDB::Rule::::BEGIN@13DateTime::TimeZone::OlsonDB::Rule::BEGIN@13
1117µs7µsDateTime::TimeZone::OlsonDB::Rule::::BEGIN@14DateTime::TimeZone::OlsonDB::Rule::BEGIN@14
1117µs12µsDateTime::TimeZone::OlsonDB::Rule::::BEGIN@10DateTime::TimeZone::OlsonDB::Rule::BEGIN@10
1117µs9µsDateTime::TimeZone::OlsonDB::Rule::::BEGIN@9DateTime::TimeZone::OlsonDB::Rule::BEGIN@9
1115µs5µ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{
321µs $DateTime::TimeZone::OlsonDB::Rule::VERSION = '1.63';
4}
5
# spent 9µs within DateTime::TimeZone::OlsonDB::Rule::BEGIN@5 which was called: # once (9µs+0s) by DateTime::TimeZone::OlsonDB::BEGIN@14 at line 7
BEGIN {
617µs $DateTime::TimeZone::OlsonDB::Rule::AUTHORITY = 'cpan:DROLSKY';
7119µs19µs}
# spent 9µs making 1 call to DateTime::TimeZone::OlsonDB::Rule::BEGIN@5
8
9220µs212µs
# spent 9µs (7+3) within DateTime::TimeZone::OlsonDB::Rule::BEGIN@9 which was called: # once (7µs+3µs) by DateTime::TimeZone::OlsonDB::BEGIN@14 at line 9
use strict;
# spent 9µs making 1 call to DateTime::TimeZone::OlsonDB::Rule::BEGIN@9 # spent 3µs making 1 call to strict::import
10220µs216µs
# spent 12µs (7+5) within DateTime::TimeZone::OlsonDB::Rule::BEGIN@10 which was called: # once (7µs+5µs) by DateTime::TimeZone::OlsonDB::BEGIN@14 at line 10
use warnings;
# spent 12µs making 1 call to DateTime::TimeZone::OlsonDB::Rule::BEGIN@10 # spent 5µs making 1 call to warnings::import
11
12224µs15µs
# spent 5µs within DateTime::TimeZone::OlsonDB::Rule::BEGIN@12 which was called: # once (5µs+0s) by DateTime::TimeZone::OlsonDB::BEGIN@14 at line 12
use DateTime;
# spent 5µs making 1 call to DateTime::TimeZone::OlsonDB::Rule::BEGIN@12
13222µs19µs
# spent 9µs within DateTime::TimeZone::OlsonDB::Rule::BEGIN@13 which was called: # once (9µs+0s) by DateTime::TimeZone::OlsonDB::BEGIN@14 at line 13
use DateTime::Duration;
# spent 9µs making 1 call to DateTime::TimeZone::OlsonDB::Rule::BEGIN@13
14230µs17µs
# spent 7µs within DateTime::TimeZone::OlsonDB::Rule::BEGIN@14 which was called: # once (7µs+0s) by DateTime::TimeZone::OlsonDB::BEGIN@14 at line 14
use DateTime::TimeZone::OlsonDB;
# spent 7µs making 1 call to DateTime::TimeZone::OlsonDB::Rule::BEGIN@14
15
162411µs277µs
# spent 43µs (9+34) within DateTime::TimeZone::OlsonDB::Rule::BEGIN@16 which was called: # once (9µs+34µs) by DateTime::TimeZone::OlsonDB::BEGIN@14 at line 16
use Params::Validate qw( validate SCALAR );
# spent 43µs making 1 call to DateTime::TimeZone::OlsonDB::Rule::BEGIN@16 # spent 34µ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
9413µs1;