[squeak-dev] Re: 100 Million objects

Paolo Bonzini bonzini at gnu.org
Fri Feb 29 08:44:59 UTC 2008


>>  > out of curiosity (forgot the reason) in a Workspace I did
>>  > a:= Array new: 100000000 withAll: 1.0
>>
>>  Unless I'm mistaken, this is two objects, an Array and a Float.
>>
> Add block contexts created for each iteration for filling array with value.

For #to:do: ?  And anyway I'd hope they are short-lived and don't make 
it into oldspace.

What Klaus wanted was, more likely, something like

   (1 to: n) collect: [ :each | each asFloat ]

(Don't try it at home with n = 100,000,000)

Paolo



More information about the Squeak-dev mailing list