Problems? Is your data what you think it is? | |
PerlMonks |
TT memory cachingby december (Pilgrim) |
on Nov 08, 2009 at 09:00 UTC ( [id://805739]=perlquestion: print w/replies, xml ) | Need Help?? |
december has asked for the wisdom of the Perl Monks concerning the following question: Hello fellow monks, I've given in to a dirty little sin -- I decided to do a quick comparison of templating systems. I'm using several different ones in diverse web applications and frameworks, but I wanted to try them in a simple setup to isolate any impact of other factors. So far I'm just processing a minimal HTML template with a simple variable 1000 times through Benchmark's timethis() function, like so:
Apart from being a rather dumb and pointless initial test, the problem here is that Template Toolkit is much slower than HTML::Template and Petal, as shown by time ./tt.pl 1>/dev/null:
(Cache is just the default built-in memory cache for those templating systems.) So I run DProf:
... but I confess I'm too ignorant about TT's code to understand the output. What I'd like to know from somebody with more knowledge of the TT code is if TT is indeed using memory caching here, and if so, why it is so much slower than the other modules? (I'd expect it not to be.) Please note I'm not interested in a flamewar about different templating systems – all of which have good and bad sides – I'm just curious as to why I'm getting the results I do. Thanks for any insight!
Back to
Seekers of Perl Wisdom
|
|