[Zope] speeding up dtml-tree

Dieter Maurer dieter@handshake.de
Tue, 15 Aug 2000 20:27:46 +0200 (CEST)


Clinton Roy writes:
 > i'm using the dtml-tree tag and generating it's contents via external
 > methods. Unfortunately child lookups are quite slow, as well as the
 > icon choosing machinery; is there any way to cache the tree node
 > objects that my external method creates?
The tree tag itself does not cache.

You could implement your own cache in your external methods.

We extended the tree tag with a "has_branches" argument.
If present, it should be a method that tells for the
current object whether it has branches (aka children).
This reduced the number of database accesses (where
our tree data really lives) by an order of magnitude.


In principle, I could give you (or the community) a
patch for "has_branches". Unfortunately, we extended
the tree tag quite drastically (configurable icons, "has_branches",
"input type=image" instead of "a href" tags for tree operations).
Thus, the "has_branches" extension comes embedded in a big
patch that may not be easy to understand.



Dieter