Schwab,Wilhelm K wrote: > Hello all, > > FWIW, Dolphin "lookup tables" use parallel arrays for keys and values. OA's > claim (I do not dispute it, I'm simply reporting what they said) is that the > result is faster than a dictionary based on associations.
Parallel arrays should indeed be faster than Associations. The overhead at add: time of creating a new Association object is an appreciable fraction of the overall add: time. But lookups should be even faster with a single array that alternates keys and values, an approach I often use. Why is this faster? Modern RAM isn't really "random access"; accesses to locations in the CPU cache can be up to two orders of magnitude faster than accesses to locations in main memory. If the key and value are next to each other, they are often in the same cache line, so the number of reads from main memory is halved. Regards, -Martin _______________________________________________ Pharo-project mailing list Pharo-project@lists.gforge.inria.fr http://lists.gforge.inria.fr/cgi-bin/mailman/listinfo/pharo-project