[Seaside] Upload speeds with Comanche

goran at krampe.se goran at krampe.se
Sun Aug 26 19:02:06 UTC 2007


Hi!

"Patrick Collison" <patrick at collison.ie> wrote:
> Hi,
> 
> On a dual-core 2.16Ghz MacBook Pro with 2GB of RAM, it takes Comanche
> 190 seconds to read a request containing a 5MB file upload. By
> comparison, the same request takes Apache 1.3 about 0.3 seconds.
> 
> By changing SocketStream>>bufferSize to use a 100kb buffer (instead of
> the standard 2kb), I got that down to 8 seconds, but at the cost of
> rapidly ballooning memory usage after a few hundred requests.

First of all - which version of Squeak is this? As others have replied I
rewrote SocketStream as FastSocketStream a while back and it is from
update 6744 the standard SocketStream implementation in Squeak. So if
you use 3.8.1 it's there. It is only in 3.7 and older images that you
would need to install it from SM and use it explicitly (since the class
then is called FastSocketStream instead of SocketStream).

The trigger for me to rewrite it (way back) was in fact the web upload
mechanism you mention because it relies on #upToAll: IIRC which had both
at least one bug and also an "exponential slowdown" problem. The larger
file the slower it was rapidly approaching infinitely slow. :)

And when I started tearing that code apart I ended up writing the
fastest code I could muster - avoiding copying at all costs, working
directly on buffers, deliberately using methods with fast underlying
primitives instead of falling back on dead slow byte-per-byte handling
etc etc.

regards, Göran


More information about the seaside mailing list