← Index
NYTProf Performance Profile   « line view »
For svc/members/upsert
  Run on Tue Jan 13 11:50:22 2015
Reported on Tue Jan 13 12:09:48 2015

Filename/usr/lib/x86_64-linux-gnu/perl5/5.20/DateTime/Infinite.pm
StatementsExecuted 69 statements in 1.38ms
Subroutines
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11113µs28µsDateTime::Infinite::::BEGIN@3 DateTime::Infinite::BEGIN@3
1118µs73µsDateTime::Infinite::::BEGIN@9 DateTime::Infinite::BEGIN@9
1118µs18µsFakeLocale::::BEGIN@132 FakeLocale::BEGIN@132
1118µs17µsDateTime::Infinite::::BEGIN@4 DateTime::Infinite::BEGIN@4
2218µs5.84msFakeLocale::::instance FakeLocale::instance
1117µs16µsDateTime::Infinite::::BEGIN@12 DateTime::Infinite::BEGIN@12
1116µs16µsDateTime::Infinite::Future::::BEGIN@38DateTime::Infinite::Future::BEGIN@38
1116µs16µsFakeLocale::::BEGIN@89 FakeLocale::BEGIN@89
1116µs12µsFakeLocale::::BEGIN@90 FakeLocale::BEGIN@90
1116µs14µsDateTime::Infinite::Future::::BEGIN@39DateTime::Infinite::Future::BEGIN@39
1116µs12µsDateTime::Infinite::Past::::BEGIN@64 DateTime::Infinite::Past::BEGIN@64
1116µs51µsDateTime::Infinite::Future::::BEGIN@41DateTime::Infinite::Future::BEGIN@41
1116µs15µsDateTime::Infinite::Past::::BEGIN@63 DateTime::Infinite::Past::BEGIN@63
1116µs46µsDateTime::Infinite::Past::::BEGIN@66 DateTime::Infinite::Past::BEGIN@66
1114µs4µsDateTime::Infinite::::BEGIN@6 DateTime::Infinite::BEGIN@6
1114µs4µsDateTime::Infinite::::BEGIN@7 DateTime::Infinite::BEGIN@7
2114µs4µsDateTime::Infinite::::_rd2ymd DateTime::Infinite::_rd2ymd
1114µs4µsFakeLocale::::BEGIN@92 FakeLocale::BEGIN@92
2112µs2µ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__[:13] DateTime::Infinite::__ANON__[:13]
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__[:133] FakeLocale::__ANON__[:133]
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;
21500ns$DateTime::Infinite::VERSION = '1.12';
3225µs242µs
# spent 28µs (13+15) within DateTime::Infinite::BEGIN@3 which was called: # once (13µs+15µs) by C4::Circulation::BEGIN@24 at line 3
use strict;
# spent 28µs making 1 call to DateTime::Infinite::BEGIN@3 # spent 15µs making 1 call to strict::import
4222µs226µs
# spent 17µs (8+9) within DateTime::Infinite::BEGIN@4 which was called: # once (8µs+9µs) by C4::Circulation::BEGIN@24 at line 4
use warnings;
# spent 17µs making 1 call to DateTime::Infinite::BEGIN@4 # spent 9µs making 1 call to warnings::import
5
6219µs14µs
# spent 4µs within DateTime::Infinite::BEGIN@6 which was called: # once (4µs+0s) by C4::Circulation::BEGIN@24 at line 6
use DateTime;
# spent 4µs making 1 call to DateTime::Infinite::BEGIN@6
7222µs14µs
# spent 4µs within DateTime::Infinite::BEGIN@7 which was called: # once (4µs+0s) by C4::Circulation::BEGIN@24 at line 7
use DateTime::TimeZone;
# spent 4µs making 1 call to DateTime::Infinite::BEGIN@7
8
9233µs2138µs
# spent 73µs (8+65) within DateTime::Infinite::BEGIN@9 which was called: # once (8µs+65µs) by C4::Circulation::BEGIN@24 at line 9
use base qw(DateTime);
# spent 73µs making 1 call to DateTime::Infinite::BEGIN@9 # spent 65µs making 1 call to base::import
10
111700nsforeach my $m (qw( set set_time_zone truncate )) {
122167µs226µs
# spent 16µs (7+10) within DateTime::Infinite::BEGIN@12 which was called: # once (7µs+10µs) by C4::Circulation::BEGIN@24 at line 12
no strict 'refs';
# spent 16µs making 1 call to DateTime::Infinite::BEGIN@12 # spent 10µs making 1 call to strict::unimport
13313µs *{"DateTime::Infinite::$m"} = sub { return $_[0] };
14}
15
16sub is_finite {0}
17sub is_infinite {1}
18
19
# spent 4µs within DateTime::Infinite::_rd2ymd which was called 2 times, avg 2µs/call: # 2 times (4µs+0s) by DateTime::_calc_local_components at line 462 of DateTime.pm, avg 2µs/call
sub _rd2ymd {
2027µs return $_[2] ? ( $_[1] ) x 7 : ( $_[1] ) x 3;
21}
22
23
# spent 2µs within DateTime::Infinite::_seconds_as_components which was called 2 times, avg 1µs/call: # 2 times (2µs+0s) by DateTime::_calc_local_components at line 467 of DateTime.pm, avg 1µs/call
sub _seconds_as_components {
2425µs return ( $_[1] ) x 3;
25}
26
27sub _stringify {
28 $_[0]->{utc_rd_days} == DateTime::INFINITY
29 ? DateTime::INFINITY . ''
30 : DateTime::NEG_INFINITY . '';
31}
32
33sub STORABLE_freeze {return}
34sub STORABLE_thaw {return}
35
36package DateTime::Infinite::Future;
371200ns$DateTime::Infinite::Future::VERSION = '1.12';
38220µs226µs
# spent 16µs (6+10) within DateTime::Infinite::Future::BEGIN@38 which was called: # once (6µs+10µs) by C4::Circulation::BEGIN@24 at line 38
use strict;
# spent 16µs making 1 call to DateTime::Infinite::Future::BEGIN@38 # spent 10µs making 1 call to strict::import
39222µs222µs
# spent 14µs (6+8) within DateTime::Infinite::Future::BEGIN@39 which was called: # once (6µs+8µs) by C4::Circulation::BEGIN@24 at line 39
use warnings;
# spent 14µs making 1 call to DateTime::Infinite::Future::BEGIN@39 # spent 8µs making 1 call to warnings::import
40
41294µs296µs
# spent 51µs (6+45) within DateTime::Infinite::Future::BEGIN@41 which was called: # once (6µs+45µs) by C4::Circulation::BEGIN@24 at line 41
use base qw(DateTime::Infinite);
# spent 51µs making 1 call to DateTime::Infinite::Future::BEGIN@41 # spent 45µs making 1 call to base::import
42
43{
4428µs25.89ms my $Pos = bless {
# spent 5.83ms making 1 call to FakeLocale::instance # spent 55µs making 1 call to DateTime::TimeZone::new
45 utc_rd_days => DateTime::INFINITY,
46 utc_rd_secs => DateTime::INFINITY,
47 local_rd_days => DateTime::INFINITY,
48 local_rd_secs => DateTime::INFINITY,
49 rd_nanosecs => DateTime::INFINITY,
50 tz => DateTime::TimeZone->new( name => 'floating' ),
51 locale => FakeLocale->instance(),
52 },
53 __PACKAGE__;
54
5513µs172µs $Pos->_calc_utc_rd;
# spent 72µs making 1 call to DateTime::_calc_utc_rd
5613µs136µs $Pos->_calc_local_rd;
# spent 36µs making 1 call to DateTime::_calc_local_rd
57
58 sub new {$Pos}
59 }
60
61package DateTime::Infinite::Past;
621200ns$DateTime::Infinite::Past::VERSION = '1.12';
63219µs224µs
# spent 15µs (6+9) within DateTime::Infinite::Past::BEGIN@63 which was called: # once (6µs+9µs) by C4::Circulation::BEGIN@24 at line 63
use strict;
# spent 15µs making 1 call to DateTime::Infinite::Past::BEGIN@63 # spent 9µs making 1 call to strict::import
64221µs217µs
# spent 12µs (6+6) within DateTime::Infinite::Past::BEGIN@64 which was called: # once (6µs+6µs) by C4::Circulation::BEGIN@24 at line 64
use warnings;
# spent 12µs making 1 call to DateTime::Infinite::Past::BEGIN@64 # spent 6µs making 1 call to warnings::import
65
662168µs286µs
# spent 46µs (6+40) within DateTime::Infinite::Past::BEGIN@66 which was called: # once (6µs+40µs) by C4::Circulation::BEGIN@24 at line 66
use base qw(DateTime::Infinite);
# spent 46µs making 1 call to DateTime::Infinite::Past::BEGIN@66 # spent 40µs making 1 call to base::import
67
68{
6926µs234µs my $Neg = bless {
# spent 31µs making 1 call to DateTime::TimeZone::new # spent 3µs making 1 call to FakeLocale::instance
70 utc_rd_days => DateTime::NEG_INFINITY,
71 utc_rd_secs => DateTime::NEG_INFINITY,
72 local_rd_days => DateTime::NEG_INFINITY,
73 local_rd_secs => DateTime::NEG_INFINITY,
74 rd_nanosecs => DateTime::NEG_INFINITY,
75 tz => DateTime::TimeZone->new( name => 'floating' ),
76 locale => FakeLocale->instance(),
77 },
78 __PACKAGE__;
79
8012µs148µs $Neg->_calc_utc_rd;
# spent 48µs making 1 call to DateTime::_calc_utc_rd
8112µs120µs $Neg->_calc_local_rd;
# spent 20µs making 1 call to DateTime::_calc_local_rd
82
83 sub new {$Neg}
84}
85
86package # hide from PAUSE
87 FakeLocale;
88
89221µs227µs
# spent 16µs (6+10) within FakeLocale::BEGIN@89 which was called: # once (6µs+10µs) by C4::Circulation::BEGIN@24 at line 89
use strict;
# spent 16µs making 1 call to FakeLocale::BEGIN@89 # spent 10µs making 1 call to strict::import
90218µs217µs
# spent 12µs (6+5) within FakeLocale::BEGIN@90 which was called: # once (6µs+5µs) by C4::Circulation::BEGIN@24 at line 90
use warnings;
# spent 12µs making 1 call to FakeLocale::BEGIN@90 # spent 5µs making 1 call to warnings::import
91
922451µs14µs
# spent 4µs within FakeLocale::BEGIN@92 which was called: # once (4µs+0s) by C4::Circulation::BEGIN@24 at line 92
use DateTime::Locale;
# spent 4µs making 1 call to FakeLocale::BEGIN@92
93
941100nsmy $Instance;
95
96
# spent 5.84ms (8µs+5.83) within FakeLocale::instance which was called 2 times, avg 2.92ms/call: # once (5µs+5.83ms) by C4::Circulation::BEGIN@24 at line 44 # once (3µs+0s) by C4::Circulation::BEGIN@24 at line 69
sub instance {
9729µs15.83ms return $Instance ||= bless { locale => DateTime::Locale->load('en_US') },
# spent 5.83ms making 1 call to DateTime::Locale::load
98 __PACKAGE__;
99}
100
101sub id {
102 return 'infinite';
103}
104
105sub language_id {
106 return 'infinite';
107}
108
109sub name {
110 'Fake locale for Infinite DateTime objects';
111}
112
113sub language {
114 'Fake locale for Infinite DateTime objects';
115}
116
11711µsmy @methods = qw(
118 script_id
119 territory_id
120 variant_id
121 script
122 territory
123 variant
124 native_name
125 native_language
126 native_script
127 native_territory
128 native_variant
129);
130
1311700nsfor my $meth (@methods) {
1322166µs227µs
# spent 18µs (8+9) within FakeLocale::BEGIN@132 which was called: # once (8µs+9µs) by C4::Circulation::BEGIN@24 at line 132
no strict 'refs';
# spent 18µs making 1 call to FakeLocale::BEGIN@132 # spent 9µs making 1 call to strict::unimport
1331121µs *{$meth} = sub { undef };
134}
135
136# Totally arbitrary
137sub first_day_of_week {
138 return 1;
139}
140
141sub prefers_24_hour_time {
142 return 0;
143}
144
1451100nsour $AUTOLOAD;
146sub AUTOLOAD {
147 my $self = shift;
148
149 my ($meth) = $AUTOLOAD =~ /::(\w+)$/;
150
151 if ( $meth =~ /format/ && $meth !~ /^(?:day|month|quarter)/ ) {
152 return $self->{locale}->$meth(@_);
153 }
154
155 return [];
156}
157
158110µs1;
159
160# ABSTRACT: Infinite past and future DateTime objects
161
162__END__