[Newbies] Efficiently writing to a file

Bert Freudenberg bert at freudenbergs.de
Tue Apr 10 21:29:48 UTC 2007


On Apr 10, 2007, at 23:22 , Ian Oversby wrote:

> Okay, I tried this and it still seems a bit slow:
>
> | myFile ios |
>
> ios := ReadWriteStream on: ''.
>
> Transcript show: 'Populate Buffer: ',
> 	(Time millisecondsToRun: [
> 		1 to: 10000 do: [
> 			:x | ios nextPutAll: ((x asString) , String crlf)
> 			]]) asString , ' millseconds' ; cr.
>

>  Is this the correct way to use the stream?

Why not write

	1 to: 10000 do: [:x | ios print: x; cr]

- Bert -




More information about the Beginners mailing list