[squeak-dev] advice on efficient socket programming sought
Adrian Lienhard
adi at netstyle.ch
Tue Jul 22 10:10:57 UTC 2008
On Jul 22, 2008, at 12:02 , Janko Mivšek wrote:
> Philippe Marschall wrote:
>
>>> 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.
>
> While optimizing Swazoo I found two things most important for really
> fast and sustainable socket performance, on all Smalltalks:
>
> 1. avoiding garbage collection for all costs. For that reason there
> is a special SwazooStream with SwazooBuffer, which reuse buffers
> instead of copying and recreating them, which it is just too usual
> in existing stream implementations.
you may also want to play with the GC parameters since the default
ones are suboptimal.
See for instance this thread http://thread.gmane.org/gmane.comp.lang.smalltalk.squeak.general/123852/focus=123888
Adrian
>
>
> 2. proper packaging of packets before sending (flush) to avoid
> sending to many too little packets on the net, which causes big
> overhead because of packet headers. In SwazooBuffer there is
> currently 8KB buffer size, which fits well in ethernet frame.
>
> Best regards
> Janko
>
> --
> Janko Mivšek
> AIDA/Web
> Smalltalk Web Application Server
> http://www.aidaweb.si
>
More information about the Squeak-dev
mailing list
|