help! advocacy resources needed fast

kosh kosh at aesaeion.com
Wed Mar 5 14:06:47 EST 2003


On Wednesday 05 March 2003 11:35 am, Skip Montanaro wrote:
>     Geoff> The bottleneck is in Zope; some portion of this could be blamed
>     Geoff> on the dynamic nature and complexity of our pages, but some
>     Geoff> portion is pushing DTML through a Python parser on every
> request.
>
> Have you tried Zope Page Templates (ZPT)?  Are they faster or slower than
> DTML?
>

My experience is that ZPT is slower then DTML. However you can get a large 
speed gain 4-10x as a realistic minimum by converting DTML to python scripts. 
I know people don't want to mix their logic and presentation and you really 
don't have to since you can have some python scripts generate the data and 
others do the markup on it. One of the fastest I have found is make the 
strings you want and using string substitution. If you need someting to be 
even faster you can do it in a python product which can operate outside the 
regular zope security framework which allows you to get further speedups over 
converting to python scripts. This even allows you to take advantage of the 
code you made in the python scripts by pushing it into a python product or 
external method. 

If after all this your app is still not fast enough run zope in profile mode 
and do your accesses to see what stuff is slow. Then try to call that code 
less often or make your code faster by use psyco for just those functions are 
recode just those functions in C/C++ using something like swig to make a 
wrapper for it. You should be able to make this far faster then any Java 
solution and still be able to write it faster.






More information about the Python-list mailing list