[ZPT] Why are ZPT in so slow, in my Contex !

michael kobald michael@beehive.de
Tue, 23 Oct 2001 13:36:13 +0200


Hi,

First the facts:
Harware: Dual PIII 800, 1Gig Ram, Raid, Win 2000 Server /Tested with Zope
2.3.3 And 2.4.2

Products:
ZPT 1.4.1 (tested with 1.4.0 and 1.3.x)

All my ZPTs resides in 1 Folder called Templates. There are abr. 70 of th=
em
in there.
We do make heavy use of Macros, but i do not think they are the problem i=
n
our case.

Second some strange things in the management screen:
- Importing of Folder Templates(800k) takes 1 Min
- Opening the Folder for viewing takes about 30sek

I wrote a method which loads all zpt from a specific Folder (eg. Template=
s)
as attributes of an Object(Folderish, Persistent), so they can be called
directly within a Page Template with
here/attr. This function will be called manually !
Code:

 def initializeTemplates(self, REQUEST=3DNone):
  """jo"""
  templates_pfad =3D self.Templates
  for template in templates_pfad.objectValues('Page Template'):
   name =3D template.id
   #Objekt wird in den Namesraum geladen
   setattr(self, name, template)


Now I have a Folderish, Persistent Object with a lot of ZPT references as
attributes.

Now the PROBLEM !!!!!!

If i change the Code of my folderish persistent Object, and i do make a
refresh of the Code.
Every thing works fine. But the first call to a method of this Object tak=
es
about 1 to 1.5 Minutes.
(Full CPU LOAD !!!!!!)
The second call about 1 s.

So there must be some initializing stuff  going on.

But what ?

If i delete almost all ZPT in the the Folder Templates, let=B4s say there=
 only
5 in this Folder
everthing is speedy.

 Theory and QUESTION !!!

How many states are possible for a ZPT ?
3 ? raw, cooked, rendered ?

Are all my attributes which refer to a ZPT, recooked after a refresh ????
And why is cooking so slow ?

How can safe my ass  ????

Thanks Michael