← 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:12 2014

Filename/usr/local/lib/perl/5.14.2/DateTime/Infinite.pm
StatementsExecuted 86 statements in 1.19ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11116µs19µsFakeLocale::::BEGIN@98 FakeLocale::BEGIN@98
11114µs17µsDateTime::Infinite::::BEGIN@6 DateTime::Infinite::BEGIN@6
2219µs4.12msFakeLocale::::instance FakeLocale::instance
1119µs18µsFakeLocale::::BEGIN@141 FakeLocale::BEGIN@141
1118µs11µsDateTime::Infinite::Future::::BEGIN@44DateTime::Infinite::Future::BEGIN@44
1118µs14µsDateTime::Infinite::::BEGIN@7 DateTime::Infinite::BEGIN@7
1117µs10µsDateTime::Infinite::Past::::BEGIN@72 DateTime::Infinite::Past::BEGIN@72
1117µs50µsDateTime::Infinite::::BEGIN@12 DateTime::Infinite::BEGIN@12
1116µs14µsDateTime::Infinite::Future::::BEGIN@45DateTime::Infinite::Future::BEGIN@45
1116µs12µsDateTime::Infinite::Past::::BEGIN@73 DateTime::Infinite::Past::BEGIN@73
1116µs45µsDateTime::Infinite::Past::::BEGIN@75 DateTime::Infinite::Past::BEGIN@75
1116µs12µsFakeLocale::::BEGIN@99 FakeLocale::BEGIN@99
1116µs52µsDateTime::Infinite::Future::::BEGIN@47DateTime::Infinite::Future::BEGIN@47
1116µs16µsDateTime::Infinite::::BEGIN@15 DateTime::Infinite::BEGIN@15
1115µs5µsFakeLocale::::BEGIN@101 FakeLocale::BEGIN@101
2115µs5µsDateTime::Infinite::::_rd2ymd DateTime::Infinite::_rd2ymd
1114µs4µsDateTime::Infinite::::BEGIN@9 DateTime::Infinite::BEGIN@9
1114µs4µsDateTime::Infinite::::BEGIN@10 DateTime::Infinite::BEGIN@10
2113µs3µsDateTime::Infinite::::_seconds_as_components DateTime::Infinite::_seconds_as_components
0000s0sDateTime::Infinite::Future::::newDateTime::Infinite::Future::new
0000s0sDateTime::Infinite::Past::::new DateTime::Infinite::Past::new
0000s0sDateTime::Infinite::::STORABLE_freeze DateTime::Infinite::STORABLE_freeze
0000s0sDateTime::Infinite::::STORABLE_thaw DateTime::Infinite::STORABLE_thaw
0000s0sDateTime::Infinite::::__ANON__[:16] DateTime::Infinite::__ANON__[:16]
0000s0sDateTime::Infinite::::_stringify DateTime::Infinite::_stringify
0000s0sDateTime::Infinite::::is_finite DateTime::Infinite::is_finite
0000s0sDateTime::Infinite::::is_infinite DateTime::Infinite::is_infinite
0000s0sFakeLocale::::AUTOLOAD FakeLocale::AUTOLOAD
0000s0sFakeLocale::::__ANON__[:142] FakeLocale::__ANON__[:142]
0000s0sFakeLocale::::first_day_of_week FakeLocale::first_day_of_week
0000s0sFakeLocale::::id FakeLocale::id
0000s0sFakeLocale::::language FakeLocale::language
0000s0sFakeLocale::::language_id FakeLocale::language_id
0000s0sFakeLocale::::name FakeLocale::name
0000s0sFakeLocale::::prefers_24_hour_time FakeLocale::prefers_24_hour_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::Infinite;
2{
32900ns $DateTime::Infinite::VERSION = '1.04';
4}
5
6229µs221µs
# spent 17µs (14+4) within DateTime::Infinite::BEGIN@6 which was called: # once (14µs+4µs) by Value::Convertor::BEGIN@61 at line 6
use strict;
# spent 17µs making 1 call to DateTime::Infinite::BEGIN@6 # spent 4µs making 1 call to strict::import
7223µs221µs
# spent 14µs (8+7) within DateTime::Infinite::BEGIN@7 which was called: # once (8µs+7µs) by Value::Convertor::BEGIN@61 at line 7
use warnings;
# spent 14µs making 1 call to DateTime::Infinite::BEGIN@7 # spent 7µs making 1 call to warnings::import
8
9219µs14µs
# spent 4µs within DateTime::Infinite::BEGIN@9 which was called: # once (4µs+0s) by Value::Convertor::BEGIN@61 at line 9
use DateTime;
# spent 4µs making 1 call to DateTime::Infinite::BEGIN@9
10222µs14µs
# spent 4µs within DateTime::Infinite::BEGIN@10 which was called: # once (4µs+0s) by Value::Convertor::BEGIN@61 at line 10
use DateTime::TimeZone;
# spent 4µs making 1 call to DateTime::Infinite::BEGIN@10
11
12234µs292µs
# spent 50µs (7+43) within DateTime::Infinite::BEGIN@12 which was called: # once (7µs+43µs) by Value::Convertor::BEGIN@61 at line 12
use base qw(DateTime);
# spent 50µs making 1 call to DateTime::Infinite::BEGIN@12 # spent 43µs making 1 call to base::import
13
1411µsforeach my $m (qw( set set_time_zone truncate )) {
152186µs226µs
# spent 16µs (6+10) within DateTime::Infinite::BEGIN@15 which was called: # once (6µs+10µs) by Value::Convertor::BEGIN@61 at line 15
no strict 'refs';
# spent 16µs making 1 call to DateTime::Infinite::BEGIN@15 # spent 10µs making 1 call to strict::unimport
16616µs *{"DateTime::Infinite::$m"} = sub { return $_[0] };
17}
18
19sub is_finite {0}
20sub is_infinite {1}
21
22
# spent 5µs within DateTime::Infinite::_rd2ymd which was called 2 times, avg 2µs/call: # 2 times (5µs+0s) by DateTime::_calc_local_components at line 451 of DateTime.pm, avg 2µs/call
sub _rd2ymd {
2327µs return $_[2] ? ( $_[1] ) x 7 : ( $_[1] ) x 3;
24}
25
26
# spent 3µs within DateTime::Infinite::_seconds_as_components which was called 2 times, avg 2µs/call: # 2 times (3µs+0s) by DateTime::_calc_local_components at line 456 of DateTime.pm, avg 2µs/call
sub _seconds_as_components {
27210µs return ( $_[1] ) x 3;
28}
29
30sub _stringify {
31 $_[0]->{utc_rd_days} == DateTime::INFINITY
32 ? DateTime::INFINITY . ''
33 : DateTime::NEG_INFINITY . '';
34}
35
36sub STORABLE_freeze {return}
37sub STORABLE_thaw {return}
38
39package DateTime::Infinite::Future;
40{
412500ns $DateTime::Infinite::Future::VERSION = '1.04';
42}
43
44221µs214µs
# spent 11µs (8+3) within DateTime::Infinite::Future::BEGIN@44 which was called: # once (8µs+3µs) by Value::Convertor::BEGIN@61 at line 44
use strict;
# spent 11µs making 1 call to DateTime::Infinite::Future::BEGIN@44 # spent 3µs making 1 call to strict::import
45223µs222µs
# spent 14µs (6+8) within DateTime::Infinite::Future::BEGIN@45 which was called: # once (6µs+8µs) by Value::Convertor::BEGIN@61 at line 45
use warnings;
# spent 14µs making 1 call to DateTime::Infinite::Future::BEGIN@45 # spent 8µs making 1 call to warnings::import
46
472103µs298µs
# spent 52µs (6+46) within DateTime::Infinite::Future::BEGIN@47 which was called: # once (6µs+46µs) by Value::Convertor::BEGIN@61 at line 47
use base qw(DateTime::Infinite);
# spent 52µs making 1 call to DateTime::Infinite::Future::BEGIN@47 # spent 46µs making 1 call to base::import
48
49{
50473µs24.17ms my $Pos = bless {
# spent 4.12ms making 1 call to FakeLocale::instance # spent 55µs making 1 call to DateTime::TimeZone::new
51 utc_rd_days => DateTime::INFINITY,
52 utc_rd_secs => DateTime::INFINITY,
53 local_rd_days => DateTime::INFINITY,
54 local_rd_secs => DateTime::INFINITY,
55 rd_nanosecs => DateTime::INFINITY,
56 tz => DateTime::TimeZone->new( name => 'floating' ),
57 locale => FakeLocale->instance(),
58 },
59 __PACKAGE__;
60
61138µs $Pos->_calc_utc_rd;
# spent 38µs making 1 call to DateTime::_calc_utc_rd
62140µs $Pos->_calc_local_rd;
# spent 40µs making 1 call to DateTime::_calc_local_rd
63
64 sub new {$Pos}
65 }
66
67package DateTime::Infinite::Past;
68{
692600ns $DateTime::Infinite::Past::VERSION = '1.04';
70}
71
72221µs213µs
# spent 10µs (7+3) within DateTime::Infinite::Past::BEGIN@72 which was called: # once (7µs+3µs) by Value::Convertor::BEGIN@61 at line 72
use strict;
# spent 10µs making 1 call to DateTime::Infinite::Past::BEGIN@72 # spent 3µs making 1 call to strict::import
73227µs218µs
# spent 12µs (6+6) within DateTime::Infinite::Past::BEGIN@73 which was called: # once (6µs+6µs) by Value::Convertor::BEGIN@61 at line 73
use warnings;
# spent 12µs making 1 call to DateTime::Infinite::Past::BEGIN@73 # spent 6µs making 1 call to warnings::import
74
75287µs284µs
# spent 45µs (6+39) within DateTime::Infinite::Past::BEGIN@75 which was called: # once (6µs+39µs) by Value::Convertor::BEGIN@61 at line 75
use base qw(DateTime::Infinite);
# spent 45µs making 1 call to DateTime::Infinite::Past::BEGIN@75 # spent 39µs making 1 call to base::import
76
77{
78469µs230µs my $Neg = bless {
# spent 29µs making 1 call to DateTime::TimeZone::new # spent 1µs making 1 call to FakeLocale::instance
79 utc_rd_days => DateTime::NEG_INFINITY,
80 utc_rd_secs => DateTime::NEG_INFINITY,
81 local_rd_days => DateTime::NEG_INFINITY,
82 local_rd_secs => DateTime::NEG_INFINITY,
83 rd_nanosecs => DateTime::NEG_INFINITY,
84 tz => DateTime::TimeZone->new( name => 'floating' ),
85 locale => FakeLocale->instance(),
86 },
87 __PACKAGE__;
88
89114µs $Neg->_calc_utc_rd;
# spent 14µs making 1 call to DateTime::_calc_utc_rd
90129µs $Neg->_calc_local_rd;
# spent 29µs making 1 call to DateTime::_calc_local_rd
91
92 sub new {$Neg}
93}
94
95package # hide from PAUSE
96 FakeLocale;
97
98221µs222µs
# spent 19µs (16+3) within FakeLocale::BEGIN@98 which was called: # once (16µs+3µs) by Value::Convertor::BEGIN@61 at line 98
use strict;
# spent 19µs making 1 call to FakeLocale::BEGIN@98 # spent 3µs making 1 call to strict::import
99220µs218µs
# spent 12µs (6+6) within FakeLocale::BEGIN@99 which was called: # once (6µs+6µs) by Value::Convertor::BEGIN@61 at line 99
use warnings;
# spent 12µs making 1 call to FakeLocale::BEGIN@99 # spent 6µs making 1 call to warnings::import
100
1012139µs15µs
# spent 5µs within FakeLocale::BEGIN@101 which was called: # once (5µs+0s) by Value::Convertor::BEGIN@61 at line 101
use DateTime::Locale;
# spent 5µs making 1 call to FakeLocale::BEGIN@101
102
1031100nsmy $Instance;
104
105
# spent 4.12ms (9µs+4.11) within FakeLocale::instance which was called 2 times, avg 2.06ms/call: # once (8µs+4.11ms) by Value::Convertor::BEGIN@61 at line 50 # once (1µs+0s) by Value::Convertor::BEGIN@61 at line 78
sub instance {
106210µs14.11ms return $Instance ||= bless { locale => DateTime::Locale->load('en_US') },
# spent 4.11ms making 1 call to DateTime::Locale::load
107 __PACKAGE__;
108}
109
110sub id {
111 return 'infinite';
112}
113
114sub language_id {
115 return 'infinite';
116}
117
118sub name {
119 'Fake locale for Infinite DateTime objects';
120}
121
122sub language {
123 'Fake locale for Infinite DateTime objects';
124}
125
12612µsmy @methods = qw(
127 script_id
128 territory_id
129 variant_id
130 script
131 territory
132 variant
133 native_name
134 native_language
135 native_script
136 native_territory
137 native_variant
138);
139
1401900nsfor my $meth (@methods) {
1412176µs228µs
# spent 18µs (9+10) within FakeLocale::BEGIN@141 which was called: # once (9µs+10µs) by Value::Convertor::BEGIN@61 at line 141
no strict 'refs';
# spent 18µs making 1 call to FakeLocale::BEGIN@141 # spent 10µs making 1 call to strict::unimport
1422232µs *{$meth} = sub { undef };
143}
144
145# Totally arbitrary
146sub first_day_of_week {
147 return 1;
148}
149
150sub prefers_24_hour_time {
151 return 0;
152}
153
1541100nsour $AUTOLOAD;
155sub AUTOLOAD {
156 my $self = shift;
157
158 my ($meth) = $AUTOLOAD =~ /::(\w+)$/;
159
160 if ( $meth =~ /format/ && $meth !~ /^(?:day|month|quarter)/ ) {
161 return $self->{locale}->$meth(@_);
162 }
163
164 return [];
165}
166
167115µs1;
168
169# ABSTRACT: Infinite past and future DateTime objects
170
171__END__