Shane Hathaway wrote:
Shane Hathaway wrote:
Philipp von Weitershausen wrote:
So using write() once doesn't at all seem like an advantage over simply
returning the data...
The interesting part is behind the scenes. If the response is large
enough (it's an adjustable threshold), the response transparently gets
sent to a temporary file. If the load on the server doesn't allow
all the responses to fit in RAM, temporary files are an advantage
because they allow the kernel to help manage the memory. (CPython's
manner of using memory makes it hard for the kernel to page most
memory held by Python processes.)
Now that I've brought more of this issue back into my head, I remember
that the advantage I just spoke of is independent of response.write().
However, there was still an advantage if a response is large enough that
it doesn't comfortably fit in RAM. response.write() allowed the
application to write the response in pieces, giving the kernel an
opportunity to swap out the response data immediately rather than
thrash. If Zope 2's ZServer didn't have this feature, zope.org would
crawl even worse than it does now. I know this because of some zope.org
debugging sessions.
You are confusing Zope 2 and Zope 3. Zope 2's response.write
does handle large output effciently, Zope 3's did not.
Jim
--
Jim Fulton mailto:[EMAIL PROTECTED] Python Powered!
CTO (540) 361-1714 http://www.python.org
Zope Corporation http://www.zope.com http://www.zope.org
_______________________________________________
Zope3-dev mailing list
[email protected]
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com