Profile of DateTime/TimeZone/OffsetOnly.pm

← Index
NYTProf Performance Profile «line view»
For -e
Run on Thu Jun 30 16:16:00 2016
Reported on Thu Jun 30 16:16:08 2016

Filename | /home/s1/perl5/perlbrew/perls/perl-5.22.1/lib/site_perl/5.22.1/DateTime/TimeZone/OffsetOnly.pm
Statements | Executed 16 statements in 850µs

Subroutines
Calls | P | F | Exclusive Time | Inclusive Time | Subroutine
--- | --- | --- | --- | --- | ---
1 | 1 | 1 | 486µs | 597µs | DateTime::TimeZone::OffsetOnly::::BEGIN@8DateTime::TimeZone::OffsetOnly::BEGIN@8
1 | 1 | 1 | 28µs | 31µs | DateTime::TimeZone::OffsetOnly::::BEGIN@3DateTime::TimeZone::OffsetOnly::BEGIN@3
1 | 1 | 1 | 14µs | 73µs | DateTime::TimeZone::OffsetOnly::::BEGIN@9DateTime::TimeZone::OffsetOnly::BEGIN@9
1 | 1 | 1 | 10µs | 16µs | DateTime::TimeZone::OffsetOnly::::BEGIN@4DateTime::TimeZone::OffsetOnly::BEGIN@4
1 | 1 | 1 | 9µs | 41µs | DateTime::TimeZone::OffsetOnly::::BEGIN@6DateTime::TimeZone::OffsetOnly::BEGIN@6
4 | 2 | 1 | 6µs | 6µs | DateTime::TimeZone::OffsetOnly::::is_utcDateTime::TimeZone::OffsetOnly::is_utc
0 | 0 | 0 | 0s | 0s | DateTime::TimeZone::OffsetOnly::::STORABLE_freezeDateTime::TimeZone::OffsetOnly::STORABLE_freeze
0 | 0 | 0 | 0s | 0s | DateTime::TimeZone::OffsetOnly::::STORABLE_thawDateTime::TimeZone::OffsetOnly::STORABLE_thaw
0 | 0 | 0 | 0s | 0s | DateTime::TimeZone::OffsetOnly::::categoryDateTime::TimeZone::OffsetOnly::category
0 | 0 | 0 | 0s | 0s | DateTime::TimeZone::OffsetOnly::::is_dst_for_datetimeDateTime::TimeZone::OffsetOnly::is_dst_for_datetime
0 | 0 | 0 | 0s | 0s | DateTime::TimeZone::OffsetOnly::::newDateTime::TimeZone::OffsetOnly::new
0 | 0 | 0 | 0s | 0s | DateTime::TimeZone::OffsetOnly::::offset_for_datetimeDateTime::TimeZone::OffsetOnly::offset_for_datetime
0 | 0 | 0 | 0s | 0s | DateTime::TimeZone::OffsetOnly::::offset_for_local_datetimeDateTime::TimeZone::OffsetOnly::offset_for_local_datetime
0 | 0 | 0 | 0s | 0s | DateTime::TimeZone::OffsetOnly::::short_name_for_datetimeDateTime::TimeZone::OffsetOnly::short_name_for_datetime

Call graph for these subroutines as a Graphviz dot language file.

Line | State ments | Time on line | Calls | Time in subs | Code
--- | --- | --- | --- | --- | ---
1 |  |  |  |  | package DateTime::TimeZone::OffsetOnly;
2 | 1 | 800ns |  |  | $DateTime::TimeZone::OffsetOnly::VERSION = '1.98';
3 | 2 | 36µs | 2 | 35µs | # spent 31µs (28+4) within DateTime::TimeZone::OffsetOnly::BEGIN@3 which was called: # once (28µs+4µs) by parent::import at line 3 use strict; # spent 31µs making 1 call to DateTime::TimeZone::OffsetOnly::BEGIN@3 # spent 4µs making 1 call to strict::import
4 | 2 | 32µs | 2 | 23µs | # spent 16µs (10+7) within DateTime::TimeZone::OffsetOnly::BEGIN@4 which was called: # once (10µs+7µs) by parent::import at line 4 use warnings; # spent 16µs making 1 call to DateTime::TimeZone::OffsetOnly::BEGIN@4 # spent 7µs making 1 call to warnings::import
5 |  |  |  |  |
6 | 2 | 33µs | 2 | 41µs | # spent 41µs (9+32) within DateTime::TimeZone::OffsetOnly::BEGIN@6 which was called: # once (9µs+32µs) by parent::import at line 6 use parent 'DateTime::TimeZone'; # spent 41µs making 1 call to DateTime::TimeZone::OffsetOnly::BEGIN@6 # spent 32µs making 1 call to parent::import, recursion: max depth 1, sum of overlapping time 32µs
7 |  |  |  |  |
8 | 2 | 259µs | 1 | 597µs | # spent 597µs (486+111) within DateTime::TimeZone::OffsetOnly::BEGIN@8 which was called: # once (486µs+111µs) by parent::import at line 8 use DateTime::TimeZone::UTC; # spent 597µs making 1 call to DateTime::TimeZone::OffsetOnly::BEGIN@8
9 | 2 | 467µs | 2 | 133µs | # spent 73µs (14+60) within DateTime::TimeZone::OffsetOnly::BEGIN@9 which was called: # once (14µs+60µs) by parent::import at line 9 use Params::Validate qw( validate SCALAR ); # spent 73µs making 1 call to DateTime::TimeZone::OffsetOnly::BEGIN@9 # spent 60µs making 1 call to Exporter::import
10 |  |  |  |  |
11 |  |  |  |  | sub new {
12 |  |  |  |  | my $class = shift;
13 |  |  |  |  | my %p = validate(
14 |  |  |  |  | @_, {
15 |  |  |  |  | offset => { type => SCALAR },
16 |  |  |  |  | }
17 |  |  |  |  | );
18 |  |  |  |  |
19 |  |  |  |  | my $offset = DateTime::TimeZone::offset_as_seconds( $p{offset} );
20 |  |  |  |  |
21 |  |  |  |  | die "Invalid offset: $p{offset}\n" unless defined $offset;
22 |  |  |  |  |
23 |  |  |  |  | return DateTime::TimeZone::UTC->new unless $offset;
24 |  |  |  |  |
25 |  |  |  |  | my $self = {
26 |  |  |  |  | name => DateTime::TimeZone::offset_as_string($offset),
27 |  |  |  |  | offset => $offset,
28 |  |  |  |  | };
29 |  |  |  |  |
30 |  |  |  |  | return bless $self, $class;
31 |  |  |  |  | }
32 |  |  |  |  |
33 |  |  |  |  | sub is_dst_for_datetime {0}
34 |  |  |  |  |
35 |  |  |  |  | sub offset_for_datetime { $_[0]->{offset} }
36 |  |  |  |  | sub offset_for_local_datetime { $_[0]->{offset} }
37 |  |  |  |  |
38 | 4 | 18µs |  |  | # spent 6µs within DateTime::TimeZone::OffsetOnly::is_utc which was called 4 times, avg 2µs/call: # 2 times (4µs+0s) by DateTime::_calc_utc_rd at line 395 of DateTime.pm, avg 2µs/call # 2 times (2µs+0s) by DateTime::_calc_local_rd at line 442 of DateTime.pm, avg 1µs/call sub is_utc {0}
39 |  |  |  |  |
40 |  |  |  |  | sub short_name_for_datetime { $_[0]->name }
41 |  |  |  |  |
42 |  |  |  |  | sub category {undef}
43 |  |  |  |  |
44 |  |  |  |  | sub STORABLE_freeze {
45 |  |  |  |  | my $self = shift;
46 |  |  |  |  |
47 |  |  |  |  | return $self->name;
48 |  |  |  |  | }
49 |  |  |  |  |
50 |  |  |  |  | sub STORABLE_thaw {
51 |  |  |  |  | my $self = shift;
52 |  |  |  |  | my $cloning = shift;
53 |  |  |  |  | my $serialized = shift;
54 |  |  |  |  |
55 |  |  |  |  | my $class = ref $self || $self;
56 |  |  |  |  |
57 |  |  |  |  | my $obj;
58 |  |  |  |  | if ( $class->isa(__PACKAGE__) ) {
59 |  |  |  |  | $obj = __PACKAGE__->new( offset => $serialized );
60 |  |  |  |  | }
61 |  |  |  |  | else {
62 |  |  |  |  | $obj = $class->new( offset => $serialized );
63 |  |  |  |  | }
64 |  |  |  |  |
65 |  |  |  |  | %$self = %$obj;
66 |  |  |  |  |
67 |  |  |  |  | return $self;
68 |  |  |  |  | }
69 |  |  |  |  |
70 | 1 | 5µs |  |  | 1;
71 |  |  |  |  |
72 |  |  |  |  | # ABSTRACT: A DateTime::TimeZone object that just contains an offset
73 |  |  |  |  |
74 |  |  |  |  | __END__