[squeak-dev] advice on efficient socket programming sought

Philippe Marschall philippe.marschall at gmail.com
Tue Jul 22 09:34:35 UTC 2008


2008/7/22 Göran Krampe <goran at krampe.se>:
> Hi!
>
> Philippe Marschall wrote:
>> 2008/7/18 Janko Mivšek <janko.mivsek at eranova.si>:
>>> Hi Philippe,
>>>
>>> By efficient you mean receiving and sending a lot such data? Or what kind of
>>> efficiency you want to achieve?
>>
>> The data comes in chunks up to 8k. I just want to read it fast with as
>> little unnecessary copies as possible. Same for writing.
>
> IIRC SocketStream has efficient upTo: and upToAll: and also supports
> #read: with a given size. I don't have an image handy so can't verify
> this - but it was I who rewrote SocketStream to its current incarnation
> and I took a great deal of care to make sure the code uses the
> underlying methods supported by primitives and also minimizing copies
> and reallocations of buffers etc.
>
> Of course, in theory you should be able to do better "manually" of
> course - but if I were you I would profile code using SocketStream and
> then decide if I really need a manual approach.

Ok, you guys got me convinced. I'll first use SocketStream and see how
it performs.

Cheers
Philippe


More information about the Squeak-dev mailing list