[ZPT] ZPT Speed Tutorial Wanted

Andy Meier andy@onyourmark.com
Thu, 12 Sep 2002 09:32:37 -0500


> Have you performed any of the generic Zope optimisation steps?
>
>    http://www.zope.org/Members/richard/docs/zope_optimisation.html
>
>
>       Richard

Thanks!!

I installed CallProfiler mentioned on that page (after a little 
re-programming for Zope 2.5) and started doing some testing.  My main 
bottleneck seems to be any code I run in the Page Templates.  Moving one 
'tal:repeat' into a dtml document shaved .4 seconds off the page rendering 
time and I saved another 0.15 seconds by simplifying a couple of ZPT 
structures in my site template.  That takes me from 1 page/sec up to 2.22 
pages/sec -- an excellent improvement.

My final bottleneck seems to be using Page Templates.  Even a simple Page 
Template costs me 400ms to render.  To compare, rendering a fairly simple 
DTML document takes 9ms.

Is there anything I can do to increase the speed of Page Templates (can I 
"pre-compile" the templates)?  Should I convert my page template into a 
python script or dtml document header and footer?

-Andy