DateTime.pm is slooow
まあ予想はしてたんですが、DateTime.pm はあまり速くないですな。
use strict;
use Benchmark;
use DateTime;
use DateTime::Format::Mail;
use POSIX ();
timethese 10000, {
datetime => sub {
my $dt = DateTime->now();
$dt->set_time_zone('Asia/Tokyo');
DateTime::Format::Mail->format_datetime($dt);
},
posix => sub {
POSIX::strftime("%a, %e %b %Y %T +0900", localtime);
},
};
結果はこれ。
Benchmark: timing 5000 iterations of datetime, posix...
datetime: 43 wallclock secs (33.41 usr + 0.29 sys = 33.70 CPU)
posix: 0 wallclock secs ( 0.41 usr + 0.05 sys = 0.46 CPU)
お話になりません ;-)
Posted by miyagawa at September 23, 2003 02:38 PM
| Permalink
| Comments (0)
| TrackBack(0)