Array new: 1000000 performance question
Brian T. Rice
water at tunes.org
Wed Jul 21 02:04:15 UTC 2004
The corollary is that if you need something that large, use a Tree or BTree
(to external data) or at least something from the LargeCollections package
(see SqueakMap), although that does not circumvent the actual hard limit
explained here.
Colin Putney <cputney at wiresong.ca> said:
> On Jul 20, 2004, at 1:29 PM, John M McIntosh wrote:
>
> > You'll note if you allocate a new object then drop it into the Array
> > then it will cause the million array object to become a root object
> > since
> > it points to an element in newspace. This causes us to iterate over
> > the million elements again and CPU time will go way up.
> >
> > Solving this issue is an exercise for the reader.
>
> I propose the following solution: don't use million-element Arrays.
>
> Cheers,
>
> Colin
More information about the Squeak-dev
mailing list
|