Re: [Pharo-project] Optimizing RunArray

2011-08-02 Thread Stéphane Ducasse
Excellent! Stef On Aug 2, 2011, at 12:11 PM, Nicolas Cellier wrote: > To complete myself, the fast #collect: already exists and is named > #mapValues: except that it modifies the RunArray in place and also > won't coalesce... > > I also gain a huge factor for #collect:as: be defining this metho

Re: [Pharo-project] Optimizing RunArray

2011-08-02 Thread Nicolas Cellier
To complete myself, the fast #collect: already exists and is named #mapValues: except that it modifies the RunArray in place and also won't coalesce... I also gain a huge factor for #collect:as: be defining this method: RunArray>>fillFrom: aCollection with: aBlock "Evaluate aBlock with ea

[Pharo-project] Optimizing RunArray

2011-08-02 Thread Nicolas Cellier
I played a bit with RunArray, and found some un-optimized features. First, I don't know why RunArray is an ArrayedCollection. It cannot #add: but it can #addFirst: and #addLast:. It cannot #add:withOccurrences: but it can #addLast:times:. Why inventing new selectors for old behaviours ? These opera