1,333 karma · joined December 31, 2016
This is gold.
But i am sure there are people who will appreciate your effort. Thank you for your work.
"We have security issues every year because we program in unsafe languages like C, and to solve this, we should start rewriting things in Rust because it's 'memory safe'."
Amazing!
than
"We did it in Rust, and we believe it's better because ..."
?
I wonder why some people in the Rust community seem to remind us every few sentences how Rust is superior to C because it's safer.
/s And now it's C, yesterday it was C++... what's next, ASM ?
You can use a family of hash functions and seed the hash table instance with a key.
The attacker won't be able to do make assumptions regarding collisions because he doesn't have access to the initial key.
The article contains also a Robin Hood implementation that overall works worse than HashMap. If you can give something recommendation on how to improve it I would forever in debt.
Also maybe there are some tricks that can be done, to have a faster Open Addressing implementation in Java.
PS: I've also tried Cuckoo Hashing and Hopscotch and they were also slower, but haven't managed to document my findings.
Looking at some discussions the open-jdk team had, they decided to continue with Separate Chaining. I don't have the link, but then I got interested to see how some Open Addressing (nothing fancy) will behave in Java, so this is the reason I've written this "article".
Unfortunately I coudln't beat HashMap with the "classic" approach, but I got close. I am curious to see a better implementation that brings more engineering tricks on the table.
After some work, I've come-up with this small library. It has no production value, but it was fun learning experience.
Look Java and python for example. The people working on the languages are quite smart, and they decided to take different routes. Who was right ?
The amount of stable libraries and stable innovative products is amazing. It's normal there's chaos, but what is good will survive the test of time.