Re: Hash table performance
On Sat, 21 Nov 2009, Patricia Shanahan wrote:
Tom Anderson wrote:
...
So, 7.5% for synchronization, 17% for boxing - we're still a good way off
this reported 32x!
...
In my experience, there are two main ways of getting a 32x performance
ratio for the same job:
1. Different algorithm.
2. Memory issues.
In this case, I suspect possibly memory issues. If the .NET table is
more compact, because of using primitives, it might fit into a level in
Jon's computer's memory hierarchy that the Java Hashtable does not fit.
This sort of thing is configuration dependent, so the performance
difference might not be reproducible on a different computer, even using
the same programs.
Ah, my machine is rather slow, and i didn't have the patience to wait for
the full-size version to run, so i did significantly reduce the size of
the table in my tests to 1000 entries, which will easily fit in L3 caches
and have pretty good representation in higher ones Thus, any effects
caused by data hugeness may be lost.
tom
--
Would you like to remember more?