On 13 March 2010 12:20, Stephan Eggermont <stephan@stack.nl> wrote:
Levente wrote:
How bad do they perform? Do you have benchmarks? With a coll := OrderedCollection new. 1 to: 10000000 do: [:i | coll add: i].
a profile of: 1 to: 100 do: [:i | coll add: i beforeIndex: 10] here takes 1438 ms. Moving memory gets to be slow. All operations that start taking O(#elements) time are no longer funny.
The usual thing to do is to start using multiple blocks of memory (like a BTree). Doubling size when growing is also not an acceptable strategy when getting close to total ram capacity.
Yes. Use right tool for to do job. An OrderedCollection can't satisfy every possible combination of tasks, which developer facing.
From this point, i barely see how we can achieve a substantial improvements in current implementation. And i think if we talk about collections, we should be focused more on a refactoring (use traits) for better library design, which will make implemetation more compact and cleaner.
Stephan
_______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project
-- Best regards, Igor Stasenko AKA sig.