Revision 1190565

Go back to digest for 31st October 2010

Optimization in KDE Base

Michael Pyne committed changes in /trunk/KDE/kdelibs/kdecore/util/kshareddatacache.cpp:

Change the hashing algorithm used for KSharedDataCache to "MurmurHash" as recommended by Markus[1] and tested for a couple of weeks by myself.

MurmurHash is ever so slightly faster than the FNVHash I had been using.
More importantly, it spreads the effect of changes in bits of the key more evenly across the bits of the hash result (the avalanche property).

As promised, the cache gets a higher utilization (about 50% is what I've seen, as opposed to 35-40%-ish), due to fewer collisions.

While I'm changing the layout of the cache I've added a timestamp variable to be fully implemented later.

This change is binary compatible, but will reset any caches loaded the first time the new code is used.

File Changes

Modified 1 files
  • /trunk/KDE/kdelibs/kdecore/util/kshareddatacache.cpp
1 files changed in total