[Zope-dev] ZPT Optimization Opportunity

Tres Seaver tseaver at zope.com
Mon Sep 27 11:25:16 EDT 2004

Fred Drake wrote:

> Are these properly labelled?  The way I read this is that things are
> just slightly faster without the patch.

Yes, you read it correctly (although I think the real answer is 
"identical performance, within margin of error").

> Is there anything to indicate that memory usage is actually improved?

I'm not there yet.  This is essentially a "zero-copy" optimization;  if 
I can show that the functionality is equivalent, with approximately the 
same performance under unloaded sites, *then* I can look into whether it 

I envision two possible benefits, which will materialize only "at scale":

   - Removing the need for the appserver thread to malloc and copy the
     Big String *may* be a win on a memory-constrained system (large
     allocations can induce funny non-linearities on the underlying
     malloc implementation).  Not having to copy values, even in C,
     should be a "pure" win, in any case.

   - Returning the iterator to medusa means that the application
     thread becomes available to service other threads that much more
     quickly.  Even if the malloc issues can't be demonstrated, the
     increase in concurrency *should* be a win here.

Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com

More information about the Zope-Dev mailing list