At 04:23 PM 3/9/2004, Jeff Anderson wrote:
--- Jason Gottshall <[EMAIL PROTECTED]> wrote:
> Yeah, I'm waiting for the go-ahead from higher up the food chain to
> implement the caching.

There is no implementation involved. Just follow Perrin's advice. By
instantiating a new TT object for every request, you are not allowing mod_perl
to do "it's thing." Use a global. No need for higher up go-aheads.

If only it were that simple...


If I understand mod_perl correctly (and I may not), a global object is common to all requests to a given httpd process, right? So if there are multiple httpd processes, the Template::Service object along with its cached templates will take up memory in each httpd process. Right there is a performance issue. If I have a potentially large number of different templates, then my gain in response time is mitigated by the fact that I may be taking up a lot of memory. Another mitigating factor is the fact that there is more than one webserver in the pool. Since TT is only used in a few parts of the site so far, the chances that the given httpd process on the given server actually has a cached copy of the requested template is relatively low. Sure, after a while most processes will have cacheded copies of most templates, but then we're back to the memory issue. Doesn't it make more sense in this situation to accept the small performance delay to compile a template when it's a relatively infrequent occurrence and it keeps the memory pool smaller?

The bottom line is that eventually we'll have literally thousands of templates, some used frequently and some infrequently. What would be really great would be to have the ability to cache the common/global templates and not cache some of the deeper modular components. But that would require a rewrite of the Provider module...

Of course, it would be great if someone out there could tell me I'm looking at it all wrong...

Jason


_______________________________________________ templates mailing list [EMAIL PROTECTED] http://lists.template-toolkit.org/mailman/listinfo/templates

Reply via email to