[Seaside-dev] Why does WABufferedResponse need a ReadWriteStream?

Lukas Renggli renggli at gmail.com
Tue Jan 27 08:50:15 UTC 2009


>>> Would this be feasible to implement in other dialects?  At worst you
>>> can do #on:from:to: but that's often unoptimized and will do a copy
>>> even when from=1.
>>
>> I guess that should be easy. In the worst case you can always
>> implement it using "contents readStream".
>
> Yes, though that introduces the additional copy.  Eliminating copies and
> object allocations is the key to efficient performance with Streams.

Exactly, that's what I am trying to peruse. If we encode on the fly we
don't need to copy and encode the response to another stream after the
request has been processes. Streaming servers might even directly
write onto the socket, without the need for duplicated behavior that
we have now.

Seaside 2.8 gets the contents of the stream and copy encodes it to the
output stream.

Seaside 2.7 rewinds the original stream and uses that as an output
stream. That's why it is currently called readWrite stream. 2.7 did
not do any output encoding AFAIR.

Lukas

-- 
Lukas Renggli
http://www.lukas-renggli.ch


More information about the seaside-dev mailing list