In praise of Text:::MicroMason

hctif on 2005-06-15T13:43:57

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.

Much googling eventually turned up this interesting benchmark so I decided to give Text::MicroMason a whirl.

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:

[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.