Re: Speeding up H::T

Sam Tregar <[email protected]>
Newsgroups gmane.comp.lang.perl.modules.html-template
Message-ID <[email protected]>
On Mon, 26 Jun 2006, Matthew wrote:

>    I've already got "use HTML::Template" in my startup.pl so
> theoretically its being compiled at server start (anyway to verify
> this?). But its the instantiation in my handler() routine that's using
> the CPU time.
>
> How I can I get H:T to preform better?

Are you pre-caching your templates in startup.pl?  There's a recipe
for that in the HTML::Template docs.  After you do it, turn on
cache_debug and see if you're getting 100% cache hits (you should if
you did it right).

Also, are you loading many templates and doing includes manually?
Switching to tmpl_include (which is processed at compile time) can be
much faster.

Lastly, if you absolutely gotta have more speed, you could try
HTML::Template::JIT.  It's got some drawbacks - not all of
HTML::Template's syntax is supported and compilation times are long -
but it is reliably 4 to 8 times faster.

-sam

Using Tomcat but need to do more? Need to support web services, security?
Get stuff done quickly with pre-integrated technology to make your job easier
Download IBM WebSphere Application Server v.1.0.1 based on Apache Geronimo
http://sel.as-us.falkag.net/sel?cmd=lnk&kid=120709&bid=263057&dat=121642
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.