Thanks for the ideas; I'll see if I can implement one or more (or get
somebody smarter than me at work to help me).

Regarding the 200:1 performance difference noted, I just checked again,
and got the same results. As Ian asked, I did a macros vs. no-macros
comparison, and use ApacheBench to test. 

The invocation below uses a template with six spans calling
here/standard_template.pt macros:

    ab -c5 -n50 http://adcdev.arinc.com/WK1/PerfTestWithMacros
    ... Yields: 
    Total transferred:      363300 bytes
    HTML transferred:       347850 bytes
    Requests per second:    1.26 [#/sec] (mean)
    Time per request:       3976.10 [ms] (mean)
    Time per request:       795.22 [ms] (mean, across all concurrent
requests)
    Transfer rate:          9.14 [Kbytes/sec] received

The next invocation uses a template with no macros, but essentially the
same output:

    ab -c5 -n50 http://adcdev.arinc.com/WK1/PerfTestNoMacros
    ... Yields:
    Total transferred:      369954 bytes
    HTML transferred:       354195 bytes
    Requests per second:    176.68 [#/sec] (mean)
    Time per request:       28.30 [ms] (mean)
    Time per request:       5.66 [ms] (mean, across all concurrent
requests)
    Transfer rate:          1307.26 [Kbytes/sec] received

I've got to get this situation fixed or we won't be able to use ZPT.
(And we see ZPT as giving us the logic vs. view separation we need and
the ability to have visual designer work on our pages.)

Further ideas, suggestions, code samples, etc. would be gratefully
accepted.

Cheers!
--
David Hancock | [EMAIL PROTECTED] | 410-266-4384 


-----Original Message-----
From: Ian Bicking [mailto:[EMAIL PROTECTED] 
Sent: Saturday, May 21, 2005 1:52 AM
To: Hancock, David (DHANCOCK)
Cc: webware-discuss@lists.sourceforge.net
Subject: Re: [Webware-discuss] ZPTKit and standard_template question


Hancock, David (DHANCOCK) wrote:
> I'm working with ZPTKit so I can use Zope Page Templates with Webware,

> and functionally things are going well. I'm seeing a performance 
> problem, and hope that someone can point me in the right direction
from 
> here.
> 
> My setup is Webware 0.8.1 plus ZPTKit and Zope Page Templates, with a 
> very simple template Routes.pt that uses macros and slots defined in 
> standard_template.pt.  There's almost nothing in the corresponding 
> Routes.py file.  If I restart WebKit, then hit the Routes page, the 
> "accessed" time (as reported by stat) reflects the current time.  From

> then on, if I hit the page again, the Routes.pt file retains it
accessed 
> time--that is, it appears not to have been reread.  That's a Good
Thing, 
> performance-wise. However, the standard_template.pt file DOES get its 
> accessed time updated with each request for the page, and this seems
to 
> be killing performance.

I never looked that closely, but that seems to be because the first 
template is going through templatetools.TemplatePool, while 'here' 
builds objects directly from templatetools.FileTemplate, which reads a 
fresh copy off the disk each time.  Actually, I don't think TemplatePool

is even needed, I think PageTemplates are threadsafe.  Maybe the whole 
thing could be simplified by simply overriding FileTemplate.__new__ so 
that it didn't return new instances if one already existed for a given 
filename.

> Using 'ab' and a 2K static HTML page, my system can serve about 200 
> requests per second. Using ZPTs, ZPTKit, standard_template.pt and 
> Routes.pt, I get about 1 page per second.

1 page per second...?  I admit I might miss performance issues, but I'd 
be surprised if I missed an issue that large.  What's the difference 
between a template with a macro and one without?

-- 
Ian Bicking  /  [EMAIL PROTECTED]  / http://blog.ianbicking.org


-------------------------------------------------------
This SF.Net email is sponsored by Oracle Space Sweepstakes
Want to be the first software developer in space?
Enter now for the Oracle Space Sweepstakes!
http://ads.osdn.com/?ad_idt12&alloc_id344&op=click
_______________________________________________
Webware-discuss mailing list
Webware-discuss@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/webware-discuss

Reply via email to