[ZPT] Cooking takes very long

Dieter Maurer dieter@handshake.de
Wed, 15 Aug 2001 11:27:03 +0200 (CEST)


We have a site with about 20 ZPTs, each about some kB in size.
When the folders that contain these ZPT are shown in the
ZMI's left frame (TreeView), then the construction of this frame
takes excessive time -- something like 1 CPU minute (on a
relatively fast Sun server).

I used the profiler to analyse this behaviour:

  When a folder is shown in a TreeDisplay, then its
  content is loaded (if necessary) in order to determine whether it
  includes folder-like subobjects.

  Loading ZPT's from the ZODB causes them to be parsed
  and cooked. This takes incredibly long.
  In the analysed case, the complete request (expanding a
  folder in the TreeView such that the ZPT containing
  folders became visible) took 83 seconds.
  80 seconds thereof were needed to parse the ZPT's.

In the final application, we will have about 200 ZPT's.
If the time increases linearly, work with Zope will
become unfeasible.

I see two options:

  *  use Frederik's "sgmlop" for parsing the ZPT's.
     This should speed up parsing considerably.

  *  store the cooked version inside the ZODB
     (as, I think, DTML does) and cook only
     after things changed.


Of course, I have a temporary option: adapt Zope's cache
parameters such that the ZPT's, onces cooked, are
held inside the caches for a long time.

However, this is only a short term solution. At least, when
ZPT becomes Zope's default templates, the problem needs to
be solved differently.


Dieter