5 ms·
If anyone is interested, I have a cute nearly-minimal perfect hashing algorithm designed to have good cache-friendly properties. It works very well in practice
by dchichkov 12y ago
If anyone is interested, I have a cute nearly-minimal perfect hashing algorithm designed to have good cache-friendly properties. It works very well in practice and in my particular application was performing faster and more consistently (no long tail) than anything found in CMPH.
Briefly, it is somewhat similar to hopscotch (or robin-hood) hashing, only you pre-calculate positions of the elements to put them into optimal spots by solving the assignment problem (via Hungarian assignment problem solver or such). Works for up to about 50k elements. It feels like it might have good theoretical properties, might be even optimal (after all, we pretty much calculating optimal positions of the elements based on the costs of our memory/cache accesses and probabilities of each element), but it was a while since I've taken the algorithms class.
If anyone is interested to do a writeup and publish clean source code - you'd be welcome, ping me via e-mail.
- rurban 12y agoI'm interested. Robin-Hood optimization was on my TODO list. Dmitry Chichkov from XAMBALA? I couldn't find your email.
- phpnode 12y agoYour email address isn't listed in your profile (you might have entered it in the "email" box, but that's not visible to other people)
- dchichkov 12y agoIt is dchichkov at gmail...