Squeak FTP much slower than Python

Ted Kaehler Ted at SqueakLand.org
Mon May 13 23:54:40 UTC 2002


Folks,
	Someone asked why Squeak is so slow to bring in a large file 
via FTP.  Here are two easy things that might make it better.

	In FTPSocket>>getDataTo: dataStream whileWatching: 
otherSocket and its five similar methods, (buf _ String new: 4000.) 
appears.  One could raise that buffer size to something much bigger.
	But, there is another bottleneck also.  A Stream is being 
created, and it grows periodically.  Here is the code that grows a 
stream:

WriteStream
pastEndPut: anObject
	collection _ collection ,
		(collection class new: ((collection size max: 20) min: 20000)).
	writeLimit _ collection size.
	collection at: (position _ position + 1) put: anObject

Note that the size is doubling each time it hits the end, but adds a 
maximum of 20k.  This was fine in the old days, but it is not good 
for reading a 4 meg file.   I suggest removing the cap altogether, or 
cap it at 1 meg added each time.  Each growth causes everything 
before to be copied again.  4meg / 20k = 200 times that the data is 
recopied during the transfer.

	Has anyone does a complete overhaul of the Squeak FTP 
handler?  Did Commanche do it?  Did ExoBox?  Could we get the code?

--Ted.

-- 
Ted Kaehler
If builders built buildings the way programmers write programs,
then the first woodpecker to come along would destroy civilization.
     --Weinberg's Second Law



More information about the Squeak-dev mailing list