-
-
Notifications
You must be signed in to change notification settings - Fork 45
Open
Description
When you use a date after 2036, the DateTime::_compare() gets called very often. This is best visible when the year is very large. The program below which makes 100,000 calls to _compare. It does behave timely without time_zone parameter.
#!/usr/bin/perl
use strict;
use warnings;
use DateTime;
use Time::HiRes qw(time);
my $dt1 = DateTime->new(year => 9999, month => 1, day => 1);
my $dt2 = DateTime->new(year => 2019, month => 5, day => 28, time_zone => 'Europe/London');
my $start = time;
my $x = $dt1 < $dt2 ? $dt1 : $dt2;
my $elapse = sprintf "%dms", (time - $start)*1000;
warn "$elapse: $x\n";Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels