I found this amusing post on the poop-group (Perl Object-Oriented Persistance) today.
----- Forwarded message from Sam Vilain <[EMAIL PROTECTED]> ----- From: Sam Vilain <[EMAIL PROTECTED]> To: Dan Sully <[EMAIL PROTECTED]> Cc: Darren Duncan <[EMAIL PROTECTED]>, [EMAIL PROTECTED] Subject: [Poop-group] Re: ... entering into the fray ... Date: Mon, 2 Jun 2003 22:17:17 +1200 Message-Id: <[EMAIL PROTECTED]> List-Archive: <http://sourceforge.net/mailarchive/forum.php?forum=poop-group> List-Subscribe: <https://lists.sourceforge.net/lists/listinfo/poop-group>, <mailto:[EMAIL PROTECTED]> List-Id: Perl Object Oriented Persistence <poop-group.lists.sourceforge.net> On Mon, 02 Jun 2003 19:52, Dan Sully wrote: > * Sam Vilain <[EMAIL PROTECTED]> shaped the electrons to say... > > d) implementing this is as simple as passing dates through > > Date::Manip::ParseDate > Please try and use the new DateTime::* modules instead of the > slower, and rather bloated Date::Manip. Thanks. > http://datetime.perl.org/ Is Date::Manip more bloated, because; a) it takes up a measly 300kB of disk space, whereas the "new" DateTime modules clock in as a more "modern" 4.5MB ? b) its compile time is an unacceptable 55% more? c) it takes less time to convert dates? d) it doesn't even require one other module - any module worth respect requires at least 5 more, like DateTime? e) it doesn't use 1337 XS code? f) it provides a one-shot function that converts pretty much any date format you care to throw at it into a standard format? Run this benchmark, then go crying home to your momma, she's waitin for ya; #!/usr/bin/perl use Benchmark; use Date::Manip; use DateTime; my $when = "2002-02-04 15:23:52.000"; timethese (10000, { "Date::Manip::ParseDate" => sub { # This massaging of the date isn't necessary - but let's # compare pureed babyfood apples with pureed babyfood apples my ($yyyy, $mm, $dd, $h, $m, $s, $f) = ($when =~ m/(\d{4})-(\d{2})-(\d{2})\s (\d{2}):(\d{2}):(\d{2})\.(\d{3})/x); my $date = ParseDate("$yyyy$mm$dd$h$m$s$f"); }, "DateTime" => sub { my ($yyyy, $mm, $dd, $h, $m, $s, $f) = ($when =~ m/(\d{4})-(\d{2})-(\d{2})\s (\d{2}):(\d{2}):(\d{2})\.(\d{3})/x); my $date = DateTime->new (year => $yyyy, month => $mm, day => $dd, hour => $h, minute => $m, second => $s, nanosecond => $f * 1e6); }, } ); Note: I'm not against progress, I agree that Date::Manip is far from perfect and has plently of room for improvement. But, really, 4.5MB? And where's the DWIM conversion function? -- Sam Vilain, [EMAIL PROTECTED] Only the ignorant man becomes angry. The wise man understands. --Indian wisdom. _______________________________________________ Poop-group mailing list [EMAIL PROTECTED] https://lists.sourceforge.net/lists/listinfo/poop-group ----- End forwarded message ----- cheers, -- Iain.
