[Top][All Lists]
[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
Re: [Help-smalltalk] OrderedCollection growing
From: |
Gwenaël Casaccio |
Subject: |
Re: [Help-smalltalk] OrderedCollection growing |
Date: |
Fri, 24 Jun 2011 13:57:07 +0200 |
I think it can be helpfull consider the situtation:
we have enough room but first <= 1 we cannot decrease (if adding item first)
what happen know a new orderedcollection is allocated and items are moved,
in the new behavior the items are just moved ("less" impact on the gc)
Gwen
On Fri, Jun 24, 2011 at 12:17 PM, Paolo Bonzini <address@hidden> wrote:
> On Fri, Jun 24, 2011 at 08:17, Gwenael Casaccio <address@hidden> wrote:
>> Hi,
>>
>> I've made a small change in OrderedCollection in growBy:shift:
>> I use the primitive VMpr_OrderedCollection_replaceFromToWithStartingAt.
>> I guess it should be possible to tweak again a bit the behavior:
>
> That's very nice, you could also implement all of
> #replaceFrom:to:with:startingAt: with the primitive instead? The
> primitive would be #primReplaceFrom:to:with:startingAt:. Then you
> don't need a change in #growBy:shift:, I think.
>
>> In addLast or addFirst if we have any free rooms but first is <= 1 or last
>>>= n we could move instead of allocating a new collection.
>
> Is it really helpful?
>
> Paolo
>