[Catalyst] Performance

Dave Rolsky autarch at urth.org
Thu Mar 8 16:59:49 GMT 2007


On Thu, 8 Mar 2007, Jim Spath wrote:

> The biggest problem seems to be localization at ~18%.  I had been using 
> Catalyst::Plugin::I18N and calling Catalyst.localize() in our templates for 
> any string that required localization.  Is there a better method for doing 
> localization, specifically with regards to performance?

You could pre-generate a set of templates for each language you support. 
That way you just need to determine the language once, and then change the 
template path or suffix or something like that.

> URI is next up at around 14% of time.  Is there anything that can be done 
> about this one?

Looking at the Catalyst internals, it seems like every time you call 
$c->uri_for() it calls URI->new_abs(). That could be the culprit.

> Lastly, Template seems to be taking up around 6%.  I suppose I could try 
> caching template output, but that will take some doing, as every page on our 
> site can vary per user.

There's various ways to optimize TT2. One big one is to use PROCESS 
instead of INCLUDE wherever possible. I'm not sure if that's your problem, 
though, from the profile.


-dave

/*===================================================
VegGuide.Org                        www.BookIRead.com
Your guide to all that's veg.       My book blog
===================================================*/



More information about the Catalyst mailing list