← Index
NYTProf Performance Profile   « block view • line view • sub view »
For 05.Domain_and_Item.t
  Run on Tue May 4 17:21:41 2010
Reported on Tue May 4 17:22:48 2010

File /usr/local/lib/perl5/site_perl/5.10.1/darwin-2level/DateTime/Infinite.pm
Statements Executed 42
Statement Execution Time 629µs
Subroutines — ordered by exclusive time
Calls P F Exclusive
Time
Inclusive
Time
Subroutine
11118µs22µsDateTime::Infinite::::BEGIN@3 DateTime::Infinite::BEGIN@3
11113µs63µsDateTime::Infinite::::BEGIN@11 DateTime::Infinite::BEGIN@11
1118µs24µsDateTime::Infinite::::BEGIN@4 DateTime::Infinite::BEGIN@4
1118µs46µsDateTime::Infinite::Future::::BEGIN@42DateTime::Infinite::Future::BEGIN@42
1117µs24µsDateTime::Infinite::::BEGIN@14 DateTime::Infinite::BEGIN@14
1117µs43µsDateTime::Infinite::Past::::BEGIN@63 DateTime::Infinite::Past::BEGIN@63
2115µs5µsDateTime::Infinite::::_rd2ymd DateTime::Infinite::_rd2ymd
1114µs4µsDateTime::Infinite::::BEGIN@8 DateTime::Infinite::BEGIN@8
1113µs3µsDateTime::Infinite::::BEGIN@9 DateTime::Infinite::BEGIN@9
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__[:15] DateTime::Infinite::__ANON__[:15]
0000s0sDateTime::Infinite::::_stringify DateTime::Infinite::_stringify
0000s0sDateTime::Infinite::::is_finite DateTime::Infinite::is_finite
0000s0sDateTime::Infinite::::is_infinite DateTime::Infinite::is_infinite
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
3322µs226µs
# spent 22µs (18+4) within DateTime::Infinite::BEGIN@3 which was called # once (18µs+4µs) by SimpleDB::Class::SQL::BEGIN@19 at line 3
use strict;
# spent 22µs making 1 call to DateTime::Infinite::BEGIN@3 # spent 4µs making 1 call to strict::import
4329µs240µs
# spent 24µs (8+16) within DateTime::Infinite::BEGIN@4 which was called # once (8µs+16µs) by SimpleDB::Class::SQL::BEGIN@19 at line 4
use warnings;
# spent 24µs making 1 call to DateTime::Infinite::BEGIN@4 # spent 16µs making 1 call to warnings::import
5
61300nsour $VERSION = '0.55';
7
8318µs14µs
# spent 4µs within DateTime::Infinite::BEGIN@8 which was called # once (4µs+0s) by SimpleDB::Class::SQL::BEGIN@19 at line 8
use DateTime;
# spent 4µs making 1 call to DateTime::Infinite::BEGIN@8
9320µs13µs
# spent 3µs within DateTime::Infinite::BEGIN@9 which was called # once (3µs+0s) by SimpleDB::Class::SQL::BEGIN@19 at line 9
use DateTime::TimeZone;
# spent 3µs making 1 call to DateTime::Infinite::BEGIN@9
10
11330µs2112µs
# spent 63µs (13+50) within DateTime::Infinite::BEGIN@11 which was called # once (13µs+50µs) by SimpleDB::Class::SQL::BEGIN@19 at line 11
use base qw(DateTime);
# spent 63µs making 1 call to DateTime::Infinite::BEGIN@11 # spent 50µs making 1 call to base::import
12
131800nsforeach my $m (qw( set set_time_zone truncate )) {
143157µs241µs
# spent 24µs (7+17) within DateTime::Infinite::BEGIN@14 which was called # once (7µs+17µs) by SimpleDB::Class::SQL::BEGIN@19 at line 14
no strict 'refs';
# spent 24µs making 1 call to DateTime::Infinite::BEGIN@14 # spent 17µs making 1 call to strict::unimport
15315µs *{"DateTime::Infinite::$m"} = sub { return $_[0] };
16}
17
18sub is_finite {0}
19sub is_infinite {1}
20
21
# spent 5µs within DateTime::Infinite::_rd2ymd which was called 2 times, avg 3µs/call: # 2 times (5µs+0s) by DateTime::_calc_local_components at line 403 of DateTime.pm, avg 3µs/call
sub _rd2ymd {
2228µs return $_[2] ? ( $_[1] ) x 7 : ( $_[1] ) x 3;
23}
24
25
# spent 3µs within DateTime::Infinite::_seconds_as_components which was called 2 times, avg 1µs/call: # 2 times (3µs+0s) by DateTime::_calc_local_components at line 408 of DateTime.pm, avg 1µs/call
sub _seconds_as_components {
2625µs return ( $_[1] ) x 3;
27}
28
29sub _stringify {
30 (
31 $_[0]->{utc_rd_days} == DateTime::INFINITY
32 ? DateTime::INFINITY . ''
33 : DateTime::NEG_INFINITY . ''
34 );
35}
36
37sub STORABLE_freeze {return}
38sub STORABLE_thaw {return}
39
40package DateTime::Infinite::Future;
41
42376µs285µs
# spent 46µs (8+39) within DateTime::Infinite::Future::BEGIN@42 which was called # once (8µs+39µs) by SimpleDB::Class::SQL::BEGIN@19 at line 42
use base qw(DateTime::Infinite);
# spent 46µs making 1 call to DateTime::Infinite::Future::BEGIN@42 # spent 38µs making 1 call to base::import
43
44{
45477µs177µs my $Pos = bless {
# spent 77µs making 1 call to DateTime::TimeZone::new
46 utc_rd_days => DateTime::INFINITY,
47 utc_rd_secs => DateTime::INFINITY,
48 local_rd_days => DateTime::INFINITY,
49 local_rd_secs => DateTime::INFINITY,
50 rd_nanosecs => DateTime::INFINITY,
51 tz => DateTime::TimeZone->new( name => 'floating' ),
52 },
53 __PACKAGE__;
54
55 $Pos->_calc_utc_rd;
# spent 32µs making 1 call to DateTime::_calc_utc_rd
56 $Pos->_calc_local_rd;
# spent 41µs making 1 call to DateTime::_calc_local_rd
57
58 sub new {$Pos}
59}
60
61package DateTime::Infinite::Past;
62
63378µs280µs
# spent 43µs (7+37) within DateTime::Infinite::Past::BEGIN@63 which was called # once (7µs+37µs) by SimpleDB::Class::SQL::BEGIN@19 at line 63
use base qw(DateTime::Infinite);
# spent 43µs making 1 call to DateTime::Infinite::Past::BEGIN@63 # spent 37µs making 1 call to base::import
64
65{
66470µs151µs my $Neg = bless {
# spent 51µs making 1 call to DateTime::TimeZone::new
67 utc_rd_days => DateTime::NEG_INFINITY,
68 utc_rd_secs => DateTime::NEG_INFINITY,
69 local_rd_days => DateTime::NEG_INFINITY,
70 local_rd_secs => DateTime::NEG_INFINITY,
71 rd_nanosecs => DateTime::NEG_INFINITY,
72 tz => DateTime::TimeZone->new( name => 'floating' ),
73 },
74 __PACKAGE__;
75
76 $Neg->_calc_utc_rd;
# spent 13µs making 1 call to DateTime::_calc_utc_rd
77 $Neg->_calc_local_rd;
# spent 30µs making 1 call to DateTime::_calc_local_rd
78
79 sub new {$Neg}
80}
81
82122µs1;
83
84__END__
85
86=head1 NAME
87
88DateTime::Infinite - Infinite past and future DateTime objects
89
90=head1 SYNOPSIS
91
92 my $future = DateTime::Infinite::Future->new;
93 my $past = DateTime::Infinite::Past->new;
94
95=head1 DESCRIPTION
96
97This module provides two L<DateTime.pm|DateTime> subclasses,
98C<DateTime::Infinite::Future> and C<DateTime::Infinite::Past>.
99
100The objects are in the "floating" timezone, and this cannot be
101changed.
102
103=head1 BUGS
104
105There seem to be lots of problems when dealing with infinite numbers
106on Win32. This may be a problem with this code, Perl, or Win32's IEEE
107math implementation. Either way, the module may not be well-behaved
108on Win32 operating systems.
109
110=head1 METHODS
111
112The only constructor for these two classes is the C<new()> method, as
113shown in the L<SYNOPSIS|/SYNOPSIS>. This method takes no parameters.
114
115All "get" methods in this module simply return infinity, positive or
116negative. If the method is expected to return a string, it return the
117string representation of positive or negative infinity used by your
118system. For example, on my system calling C<year()> returns a number
119which when printed appears either "inf" or "-inf".
120
121The object is not mutable, so the C<set()>, C<set_time_zone()>, and
122C<truncate()> methods are all do-nothing methods that simply return
123the object they are called with.
124
125Obviously, the C<is_finite()> method returns false and the
126C<is_infinite()> method returns true.
127
128=head1 AUTHOR
129
130Dave Rolsky <autarch@urth.org>
131
132=head1 COPYRIGHT
133
134Copyright (c) 2003-2010 David Rolsky. All rights reserved. This
135program is free software; you can redistribute it and/or modify it
136under the same terms as Perl itself.
137
138The full text of the license can be found in the LICENSE file included
139with this module.
140
141=head1 SEE ALSO
142
143datetime@perl.org mailing list
144
145http://datetime.perl.org/
146
147=cut
148