Writing a large Collection of integers to a file fast

André Wendt andre.wendt at hpi.uni-potsdam.de
Sat Jan 26 11:37:24 UTC 2008


I'm looking for a fast way to write a large Collection of ints (over 6
million elements) to a file. My attempt was:

aFile := CrLfFileStream fileNamed: aFilename.
aLargeCollection do: [ :int |
  aFile nextPutAll: int printString, String cr.
aFile close.

Unfortunately, this takes more than fifteen minutes. I suspect this is
due to my implementation.

Is there any smart way I can do this faster?


More information about the Squeak-dev mailing list