On Tue, 04 Jan 2005 18:54:53 -0500, Perrin Harkins <[EMAIL PROTECTED]> wrote: > On Tue, 2005-01-04 at 17:18 -0500, Cees Hek wrote: > > This works well for me. But then again, I am not caching these > > objects across requests > > Caching the object is very important. It makes a big difference in > performance. Please change that.
It might boost performance, but it can also have unexpected consequences. If I am running several different applications on the same mod_perl server, then the TT singleton is going to be configured by the first app that is executed, even though the apps may have significantly different configuration options. This is one of the reasons I don't like Log::Log4perl which can only be used as a singleton. I guess object pooling like Apache::DBI does with DB connections could deal with the multiple configuration issues, but that seems like overkill. I can definately see the benefits of singletons though, and I'll see about making it a configuration option. That would at least leave it up to the developer to decide whether it would be a benefit. > (Hmm... maybe CPAN needs some kind of Template::Toolkit::Singleton > module to make this more obvious to people.) It shouldn't be very difficult to build... > > I'll have to look back at your example from the other day, but from > > what I remember, it looks like changing the INCLUDE_PATH would change > > it for all subsequent calls to 'process'. Is that correct? > > Yes. > > > Would > > that be an acceptable behaviour? > > I think so, since I assume that people will either not change it or > change it on every request. Again, that would be fine in a single application (assuming there is some consistency in the code), but can get you into trouble if you have several applications that don't all manually set the INCLUDE_PATH. Although, I guess that can be solved through clear documentation. Cheers, -- Cees Hek _______________________________________________ templates mailing list [email protected] http://lists.template-toolkit.org/mailman/listinfo/templates
