[Mono-dev] Optimized Dictionary`2

Juraj Skripsky js at hotfeet.ch
Thu May 31 05:41:02 EDT 2007


Ahoj Marek,

I separated "table" and "linkSlots" on purpose, it was one of my last
optimizations. It speeds up (albeit only slightly) methods reading from
the dictionary, as those method do _one single_ look-up in "table" and
often _many_ look-ups in "linkSlots" (so the separation improves cache
locality for large dictionaries).

All random numbers used in the benchmark are initialized with a
hardcoded seed value, so numbers will be reproducible.
Only CodeBench.Shuffle() uses "real" random numbers for calculating a
random order of execution of the methods to be benchmarked. This should
not affect the resulting times (and testing confirmed this for me).

Juraj


On Wed, 2007-05-30 at 21:20 +0200, marek.safar at seznam.cz wrote:
> Hello Juraj,
> > 
> > I've already sent this mail to the list about a month ago and got no
> > response whatsoever...
> > 
> > To get some attention: The attached optimized Dictionary is in some
> > cases almost _twice as fast_ compared to the current implementation!
> 
> I think the implementation is quite good. I am jut not sure whether you
> have to separate table and linkSlot. I should be possible to merge them.
> 
> Secondly using random numbers in your benchmark program makes
> it really hardly reproducible, so we are really not sure what is the
> improvement.
> 
> Regards,
> Marek
> 




More information about the Mono-devel-list mailing list