[Zope] slow DocumentTemplate (dtml) import speed
Federico Grau
donfede@casagrau.org
Tue, 9 Jan 2001 18:11:53 -0500
Hello,
I am using the DocumentTemplate (dtml) portion of zope in a python program
using cgi. The "import DocumentTemplate" step alone seems to take almost 1
(ONE) second on my hardware. This seems extremely high compared with the load
time of python alone of about 0.3 seconds.
To benchmark this, I made a simple test python script (time_test.py):
#!/usr/bin/python
import time
t1 = time.time()
###import DocumentTemplate
t2 = time.time()
print "t1:%s t2:%s diff:%s" % (time.ctime(t1), time.ctime(t2), t2 - t1)
Run as "time ./time_test" with the DocumentTemplate line commented out, the
script takes an average of 0.330 seconds real time. If I uncomment the import
statement, the script takes an average of 1.350 seconds real time and a 'diff
time' of 0.9 seconds representing time spent importing DocumentTemplate.
Now, I hope not to be laughed out of the list :-D, but my hardware is a
Pentium 100 with 48 Meg of ram. I am running redhat 6.2 with python 1.5.2.
My DocumentTemplate is extracted from Zope 2.2.2 and placed in my
'site-packages' directory.
My questions:
- Do people have any suggestions on how to make this process any quicker?
- Are there any plans to speed up/optimize DocumentTemplate (I see there is
already a cDocumentTemplate file, not sure what else can be done)?
- I see there is a new version of Zope (2.2.5), does it have any major speed
improvements in DocumentTemplate (the changelog and history files did not
reflect this)?
thanks,
donfede