On Thu, Aug 17, 2006 at 04:50:46PM -0500, Frank Wiles wrote: > On Thu, 17 Aug 2006 16:54:08 -0400 > Jonathan Vanasco <[EMAIL PROTECTED]> wrote: > > > > > On Aug 17, 2006, at 1:09 PM, Perrin Harkins wrote: > > > You should create a single Template object, put it in a global, and > > > reuse it. > > > > I'm not sure how template toolkit works, but in Petal I loop through > > all my templates and compile them into memory on startup. Adds 3mb > > to my parent process, but saves 3mb from every child. if TT works > > the same way, i'd suggest looking into making that happen. > > TT handles all of that for you. It can even cache them on disk for you > so you don't have to bother recompiling them on startup if they > haven't changed.
AFAIK TT doesn't precompile templates, it caches them on first use. Which means you'll take the hit in each forked child unless you explicitly precompile them. But perhaps I'm wrong about that? /joel