On Tue, 2004-03-02 at 15:07, Chris Ochs wrote:
> I've been trying to think of a way to do just that given what I am trying to
> accomplish.

Have you profiles your app?  Frankly, I think you are wasting your time
trying to optimize something so simple.  It would be different if the
constructors did giant database queries or something.

> I chose not to use the plugin architecture for adding new
> functionality because I didn't like having to call [% use MyModule %] before
> accessing functions in MyModule.

Perhaps you didn't realize that you can just tell TT to load a bunch of
plugins when you call Template->new() and then you never have to load
them explicitly in your template.

> I think that my best course is to probably just keep the number of modules
> that contain custom tags to a relatively small number, which is fine.

It would take thousands of calls to constructors like the one you showed
us before you'd be able to even notice the time difference.  However, if
you start doing something slow in your constructors at some point you
can try using lazy-loading with something like Class::LazyObject.

- Perrin


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

Reply via email to