[Zope-dev] Caching a tree tag

Jeffrey Harris jeffrey@ic.org
Tue, 29 Aug 2000 15:21:56 -0500


Hello!

I've got a site set up using Zope, I'm very pleased with it for the most 
part, but I have some complicated threaded discussion pages that use the 
tree tag, and they're taking FOREVER to load.

I'm not completely certain which part of the system is taking so long.  My 
first question is, is there an easy way to profile python routines?  I 
don't know of a quick way, I'd love to hear suggestions.

The second question I have is about the tree tag.  I suspect that my pages 
are taking so long to render because my branches methods are pretty 
expensive.  One possibility for me is to optimize this code.  But I don't 
think this will really solve the problem.

What I'd like to do is cache the tree structure.  I don't want to cache the 
objects, just references to the nodes.  Would this take just a little 
tweaking of the zope internals, or a lot?  Again, I'd love any suggestions.

Finally, how much overhead do you get from the tree tag, relative to an in 
tag, if the branches method is cheap?  If I can't cache Zope's tree 
structure, I will probably make my own tree object storing references to 
the appropriate objects.  Would recursing over this object with an in tag 
give me any performance improvement?

Thanks!

In community,
Jeffrey Harris,
Skyhouse Consulting