[ZPT] ZPT Speed Tutorial Wanted

Andy Meier andy@onyourmark.com
Mon, 23 Sep 2002 09:11:16 -0500


After much system profiling, I gave up and started from scratch with a new 
Zope install.  I installed the products my site uses one by one and 
benchmarked Zope after each install.

On a new install, a fairly basic page template (/Examples/index_html) took an 
average of only 11 ms to render.  This time stayed constant until I installed 
the NuxWidgets product.  After that install, it took over 400ms to render the 
test page template.

I did some optimization of the NuxWidgets code and was able to get that time 
down from 400ms to 59ms.  My next task will be to change the way NuxWidgets 
works so that it only uses processor time when it is actually used in a page 
rather than any time any PageTemplate is called.

Thanks to all the people who have helped me on this!

Sincerely,
Andrew A. Meier

On Thursday 12 September 2002 09:32, Andy Meier wrote:
> 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
>
> _______________________________________________
> ZPT mailing list
> ZPT@zope.org
> http://lists.zope.org/mailman/listinfo/zpt