Philipp von Weitershausen wrote:
  page 204, Example 12.24, line 17: Using the ``write()`` method of
  HTTP-based responses does not provide a performance advantage in
  Zope X3 3.0 and 3.1 and is not supported anymore in Zope 3.2 and

I would like to point out that response.write() originally did provide an advantage by transparently putting large output into a temporary file rather than holding it in RAM. This is a performance advantage for highly concurrent sites sending multiple megabytes over relatively slow links, since it allows precious database threads to be freed while the kernel optionally pages out the response until the client finishes downloading.

However, the original response.write() does not provide a performance advantage in most situations because the original write() API pushes data; the data has nowhere to go except some temporary storage until the client is ready for it. Temporary storage is somewhat expensive. Pulling data instead is likely to provide a performance benefit in more situations.

So I fully agree that the original write() should go (in fact I suppose it's gone already), but to say there was no performance advantage is imprecise. I spent a fair amount of time making write() fast, with some success.

Zope3-dev mailing list

Reply via email to