hctif's Journal http://use.perl.org/~hctif/journal/ hctif's use Perl Journal en-us use Perl; is Copyright 1998-2006, Chris Nandor. Stories, comments, journals, and other submissions posted on use Perl; are Copyright their respective owners. 2012-01-25T02:48:36+00:00 pudge pudge@perl.org Technology hourly 1 1970-01-01T00:00+00:00 hctif's Journal http://use.perl.org/images/topics/useperl.gif http://use.perl.org/~hctif/journal/ In praise of Text:::MicroMason http://use.perl.org/~hctif/journal/25211?from=rss I have been using the Template Toolkit for a while but came across a nasty performance degradation when my input data hash ballooned from 1K to 10K items - the CPU maxed out for up to 2 minutes while a single 2MB template was generated. <p> Much googling eventually turned up this interesting <a href="http://www.gtchat.de/templateengines/templateengines_en.html">benchmark</a> so I decided to give Text::MicroMason a whirl. </p><p> A quick trip to CPAN, an hour to convert the 150 line template from TT to MM syntax, and what do you know - identical output being produced in less than 10% of the time! The author says it all:</p><p> <i>[Text::MicroMason] provides a reasonable subset of HTML::Mason syntax in a very light-weight fashion. In comparison to the other modules listed, MicroMason aims to be fairly lightweight, using one eval per parse, converting the template to an (sic) cacheable unblessed subroutine ref, eschewing method calls, and containing less than a thousand lines of Perl code. </i></p> hctif 2005-06-15T13:43:57+00:00 journal