[Koha-bugs] [Bug 13813] Remove deprecated module C4::Dates from system

bugzilla-daemon at bugs.koha-community.org bugzilla-daemon at bugs.koha-community.org
Wed Apr 15 10:28:37 CEST 2015


http://bugs.koha-community.org/bugzilla3/show_bug.cgi?id=13813

--- Comment #136 from Jonathan Druart <jonathan.druart at biblibre.com> ---
(In reply to Jonathan Druart from comment #135)
> Something else: I did not try but... C4::Dates was (is) very efficient to
> format a date from an iso date.
> Now we have to call dt_from_string and output_pref.
> Maybe we should introduce a new subroutine without calls to DateTime to do
> this job.

% more t.pl
use C4::Dates qw(format_date);
my $iso_date = '2015-04-10 09:30:03';
for ( 1 .. 10000 ) {
    format_date($iso_date);
}
% time perl t.pl
perl t.pl  0.78s user 0.01s system 99% cpu 0.795 total
% time perl t.pl
perl t.pl  0.74s user 0.01s system 99% cpu 0.749 total
% time perl t.pl
perl t.pl  0.71s user 0.02s system 99% cpu 0.735 total


% more t.pl
use Koha::DateUtils;
my $iso_date = '2015-04-10 09:30:03';
for ( 1 .. 10000 ) {
    output_pref({ dt => dt_from_string( $iso_date, 'iso' ), dateonly => 1 });
}

% time perl t.pl
perl t.pl  2.40s user 0.02s system 100% cpu 2.424 total
% time perl t.pl
perl t.pl  2.42s user 0.02s system 99% cpu 2.442 total
% time perl t.pl
perl t.pl  2.43s user 0.01s system 100% cpu 2.439 total

-- 
You are receiving this mail because:
You are watching all bug changes.


More information about the Koha-bugs mailing list