[Catalyst] context in ::V::TT::new()

Perrin Harkins perrin at elem.com
Tue Jul 19 00:02:37 CEST 2005


On Mon, 2005-07-18 at 14:55 -0700, Todd Holbrook wrote:
> I needed similar functionality - changing INCLUDE_PATH based on part
> of the URL.  I ended up copying the Catalyst::View::TT code into a
> view for the application and moved the bulk of the new() code into
> process() where the context is available.  It's less efficient,
> obviously, but it's working for me.  I haven't profiled it yet to see
> what the impact is.

You're calling Template->new() on every request?  Don't do that.  It's a
big performance hit (you are basically turning off caching) and is not
required just to change the include path.  Check the Template Toolkit
list archives (or the Maypole ones) for examples of modifying the
include path.

- Perrin




More information about the Catalyst mailing list