5 ms·
While I agree with all you said, one can expand a bit on it. There are concrete max search depth expectations for well randomizing hash functions such as:
by cb321 4y ago
While I agree with all you said, one can expand a bit on it. There are concrete max search depth expectations for well randomizing hash functions such as:
https://www.sciencedirect.com/science/article/abs/pii/019667748790040X
which is notably logarithmic - not unlike a B-Tree.
When these expectations are exceeded you can at least detect a DoS attack. If you wait until such are seen, you can activate a "more random" mitigation on the fly at about the same cost as "the next resize/re-org/whatnot".
All you need to do is instrument your search to track the depth. There is some example such strategy in Nim at https://github.com/c-blake/adix https://github.com/c-blake/adix for simple Robin-Hood Linear Probed tables and a formula based one from that above paper inside https://github.com/c-blake/suggest https://github.com/c-blake/suggest
This is all more about the "attack" scenario than the "truly hard" real-time scenario, of course.