Stream and String performances

Damien Cassou damien.cassou at gmail.com
Mon Apr 2 15:25:36 UTC 2007


Hi,

can somebody explain me the following result:

[
	stream := WriteStream on: String new.
	stream nextPutAll: 'something to be put'.
	stream nextPutAll: 'something else to be put too'.
	] bench.                                ===> '206796.4407118576 per second.'
.
[
	stream := WriteStream on: Array new.
	stream nextPutAll: 'something to be put'.
	stream nextPutAll: 'something else to be put too'.
	] bench.                                ===>  '26177.36452709458 per second.'


Why does streaming over Strings is 10 times faster than streaming over Arrays?

Thank you

-- 
Damien Cassou



More information about the Squeak-dev mailing list