<html><head></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br><div><div>On Dec 21, 2010, at 2:24 PM, <a href="mailto:exarkun@twistedmatrix.com">exarkun@twistedmatrix.com</a> wrote:</div><br class="Apple-interchange-newline"><blockquote type="cite"><span class="Apple-style-span" style="border-collapse: separate; font-family: Menlo; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-border-horizontal-spacing: 0px; -webkit-border-vertical-spacing: 0px; -webkit-text-decorations-in-effect: none; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; font-size: medium; "><span class="Apple-style-span" style="font-family: monospace; ">Instead, you have to go all the<span class="Apple-converted-space">&nbsp;</span>way to producers/consumers, and only write more data to the transport<span class="Apple-converted-space">&nbsp;</span>buffer when it has finished dealing with what you previously gave it.<br></span></span></blockquote></div><br><div>While everybody should of course use producers and consumers, I feel like there should be a twisted core ticket for this behavior of transport buffering, and a twisted web ticket for this behavior of the request buffering. &nbsp;The naive implementation _could_ be much cheaper memory-wise; at the very least, twisted.web.static.Data ought to do the smart thing.</div><div><br></div><div>Would there be some deleterious effect to another usage pattern to fixing this? &nbsp;AFAIK there's no network in the world where you'll ever _actually_ be able to send more than about 64k in one send() anyway, and Twisted doesn't even try to do more than 128k (c.f. twisted.internet.abstract.FileDescriptor).</div></body></html>