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

Filename/usr/local/lib/perl/5.14.2/DateTime/Infinite.pm
StatementsExecuted 86 statements in 2.77ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11129µs37µsDateTime::Infinite::::BEGIN@6 DateTime::Infinite::BEGIN@6
22121µs9.22msFakeLocale::::instance FakeLocale::instance
11120µs27µsDateTime::Infinite::Future::::BEGIN@44DateTime::Infinite::Future::BEGIN@44
11118µs25µsDateTime::Infinite::Past::::BEGIN@72 DateTime::Infinite::Past::BEGIN@72
11117µs23µsFakeLocale::::BEGIN@98 FakeLocale::BEGIN@98
11117µs112µsDateTime::Infinite::::BEGIN@12 DateTime::Infinite::BEGIN@12
11117µs29µsDateTime::Infinite::::BEGIN@7 DateTime::Infinite::BEGIN@7
11116µs31µsDateTime::Infinite::Future::::BEGIN@45DateTime::Infinite::Future::BEGIN@45
11115µs29µsDateTime::Infinite::Past::::BEGIN@73 DateTime::Infinite::Past::BEGIN@73
11115µs115µsDateTime::Infinite::Future::::BEGIN@47DateTime::Infinite::Future::BEGIN@47
11115µs38µsFakeLocale::::BEGIN@141 FakeLocale::BEGIN@141
11114µs36µsDateTime::Infinite::::BEGIN@15 DateTime::Infinite::BEGIN@15
11114µs102µsDateTime::Infinite::Past::::BEGIN@75 DateTime::Infinite::Past::BEGIN@75
11114µs27µsFakeLocale::::BEGIN@99 FakeLocale::BEGIN@99
11112µs12µsFakeLocale::::BEGIN@101 FakeLocale::BEGIN@101
21111µs11µsDateTime::Infinite::::_rd2ymd DateTime::Infinite::_rd2ymd
1119µs9µsDateTime::Infinite::::BEGIN@10 DateTime::Infinite::BEGIN@10
1119µs9µsDateTime::Infinite::::BEGIN@9 DateTime::Infinite::BEGIN@9
2117µs7µ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{
322µs $DateTime::Infinite::VERSION = '1.04';
4}
5
6267µs245µs
# spent 37µs (29+8) within DateTime::Infinite::BEGIN@6 which was called: # once (29µs+8µs) by Value::Convertor::BEGIN@61 at line 6
use strict;
# spent 37µs making 1 call to DateTime::Infinite::BEGIN@6 # spent 8µs making 1 call to strict::import
7249µs241µs
# spent 29µs (17+12) within DateTime::Infinite::BEGIN@7 which was called: # once (17µs+12µs) by Value::Convertor::BEGIN@61 at line 7
use warnings;
# spent 29µs making 1 call to DateTime::Infinite::BEGIN@7 # spent 12µs making 1 call to warnings::import
8
9245µs19µs
# spent 9µs within DateTime::Infinite::BEGIN@9 which was called: # once (9µs+0s) by Value::Convertor::BEGIN@61 at line 9
use DateTime;
# spent 9µs making 1 call to DateTime::Infinite::BEGIN@9
10252µs19µs
# spent 9µs within DateTime::Infinite::BEGIN@10 which was called: # once (9µs+0s) by Value::Convertor::BEGIN@61 at line 10
use DateTime::TimeZone;
# spent 9µs making 1 call to DateTime::Infinite::BEGIN@10
11
12279µs2207µs
# spent 112µs (17+95) within DateTime::Infinite::BEGIN@12 which was called: # once (17µs+95µs) by Value::Convertor::BEGIN@61 at line 12
use base qw(DateTime);
# spent 112µs making 1 call to DateTime::Infinite::BEGIN@12 # spent 95µs making 1 call to base::import
13
1412µsforeach my $m (qw( set set_time_zone truncate )) {
152448µs257µs
# spent 36µs (14+21) within DateTime::Infinite::BEGIN@15 which was called: # once (14µs+21µs) by Value::Convertor::BEGIN@61 at line 15
no strict 'refs';
# spent 36µs making 1 call to DateTime::Infinite::BEGIN@15 # spent 21µs making 1 call to strict::unimport
16637µs *{"DateTime::Infinite::$m"} = sub { return $_[0] };
17}
18
19sub is_finite {0}
20sub is_infinite {1}
21
22
# spent 11µs within DateTime::Infinite::_rd2ymd which was called 2 times, avg 6µs/call: # 2 times (11µs+0s) by DateTime::_calc_local_components at line 451 of DateTime.pm, avg 6µs/call
sub _rd2ymd {
23218µs return $_[2] ? ( $_[1] ) x 7 : ( $_[1] ) x 3;
24}
25
26
# spent 7µs within DateTime::Infinite::_seconds_as_components which was called 2 times, avg 4µs/call: # 2 times (7µs+0s) by DateTime::_calc_local_components at line 456 of DateTime.pm, avg 4µs/call
sub _seconds_as_components {
27220µ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{
4121µs $DateTime::Infinite::Future::VERSION = '1.04';
42}
43
44250µs233µs
# spent 27µs (20+7) within DateTime::Infinite::Future::BEGIN@44 which was called: # once (20µs+7µs) by Value::Convertor::BEGIN@61 at line 44
use strict;
# spent 27µs making 1 call to DateTime::Infinite::Future::BEGIN@44 # spent 7µs making 1 call to strict::import
45260µs246µs
# spent 31µs (16+15) within DateTime::Infinite::Future::BEGIN@45 which was called: # once (16µs+15µs) by Value::Convertor::BEGIN@61 at line 45
use warnings;
# spent 31µs making 1 call to DateTime::Infinite::Future::BEGIN@45 # spent 15µs making 1 call to warnings::import
46
472239µs2214µs
# spent 115µs (15+100) within DateTime::Infinite::Future::BEGIN@47 which was called: # once (15µs+100µs) by Value::Convertor::BEGIN@61 at line 47
use base qw(DateTime::Infinite);
# spent 115µs making 1 call to DateTime::Infinite::Future::BEGIN@47 # spent 100µs making 1 call to base::import
48
49{
502156µs29.34ms my $Pos = bless {
# spent 9.21ms making 1 call to FakeLocale::instance # spent 127µ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
6116µs168µs $Pos->_calc_utc_rd;
# spent 68µs making 1 call to DateTime::_calc_utc_rd
6217µs192µs $Pos->_calc_local_rd;
# spent 92µs making 1 call to DateTime::_calc_local_rd
63
64 sub new {$Pos}
65 }
66
67package DateTime::Infinite::Past;
68{
6922µs $DateTime::Infinite::Past::VERSION = '1.04';
70}
71
72250µs231µs
# spent 25µs (18+6) within DateTime::Infinite::Past::BEGIN@72 which was called: # once (18µs+6µs) by Value::Convertor::BEGIN@61 at line 72
use strict;
# spent 25µs making 1 call to DateTime::Infinite::Past::BEGIN@72 # spent 6µs making 1 call to strict::import
73262µs243µs
# spent 29µs (15+14) within DateTime::Infinite::Past::BEGIN@73 which was called: # once (15µs+14µs) by Value::Convertor::BEGIN@61 at line 73
use warnings;
# spent 29µs making 1 call to DateTime::Infinite::Past::BEGIN@73 # spent 14µs making 1 call to warnings::import
74
752206µs2191µs
# spent 102µs (14+88) within DateTime::Infinite::Past::BEGIN@75 which was called: # once (14µs+88µs) by Value::Convertor::BEGIN@61 at line 75
use base qw(DateTime::Infinite);
# spent 102µs making 1 call to DateTime::Infinite::Past::BEGIN@75 # spent 88µs making 1 call to base::import
76
77{
782147µs269µs my $Neg = bless {
# spent 67µs making 1 call to DateTime::TimeZone::new # spent 2µ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
8916µs131µs $Neg->_calc_utc_rd;
# spent 31µs making 1 call to DateTime::_calc_utc_rd
9017µs166µs $Neg->_calc_local_rd;
# spent 66µs making 1 call to DateTime::_calc_local_rd
91
92 sub new {$Neg}
93}
94
95package # hide from PAUSE
96 FakeLocale;
97
98246µs229µs
# spent 23µs (17+6) within FakeLocale::BEGIN@98 which was called: # once (17µs+6µs) by Value::Convertor::BEGIN@61 at line 98
use strict;
# spent 23µs making 1 call to FakeLocale::BEGIN@98 # spent 6µs making 1 call to strict::import
99246µs241µs
# spent 27µs (14+14) within FakeLocale::BEGIN@99 which was called: # once (14µs+14µs) by Value::Convertor::BEGIN@61 at line 99
use warnings;
# spent 27µs making 1 call to FakeLocale::BEGIN@99 # spent 14µs making 1 call to warnings::import
100
1012314µs112µs
# spent 12µs within FakeLocale::BEGIN@101 which was called: # once (12µs+0s) by Value::Convertor::BEGIN@61 at line 101
use DateTime::Locale;
# spent 12µs making 1 call to FakeLocale::BEGIN@101
102
1031200nsmy $Instance;
104
105
# spent 9.22ms (21µs+9.19) within FakeLocale::instance which was called 2 times, avg 4.61ms/call: # once (19µs+9.19ms) by Value::Convertor::BEGIN@61 at line 50 # once (2µs+0s) by Value::Convertor::BEGIN@61 at line 78
sub instance {
106223µs19.19ms return $Instance ||= bless { locale => DateTime::Locale->load('en_US') },
# spent 9.19ms 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
12615µ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
14012µsfor my $meth (@methods) {
1412409µs261µs
# spent 38µs (15+23) within FakeLocale::BEGIN@141 which was called: # once (15µs+23µs) by Value::Convertor::BEGIN@61 at line 141
no strict 'refs';
# spent 38µs making 1 call to FakeLocale::BEGIN@141 # spent 23µs making 1 call to strict::unimport
1422273µ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
1541200nsour $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
167136µs1;
168
169# ABSTRACT: Infinite past and future DateTime objects
170
171__END__