robclu / leapfrog

Lock-free concurrent and single-threaded hash map implementations using Leapfrog probing. Currently the highest performance concurrent HashMap in Rust for certain use cases.
Apache License 2.0
202 stars 9 forks source link

Can you confirm leapfrog is now a drop-in replacement for the std hashmaps? #4

Closed mw66 closed 2 years ago

mw66 commented 2 years ago

Hi,

Just saw this:

https://www.reddit.com/r/rust/comments/shw313/comment/hv5b0uz/

The primary limitation of the map is that it does not store keys, but rather hashes of the keys. Thus far this has not been a limitation, however, it would be possible to add key support, if neccessary.

That means that leapfrog isn't usable as drop-in replacement for the hashmaps it is compared to.

Just want to confirm this key issue has been fixed.

Thanks.

robclu commented 2 years ago

Hi,

Yeah, the maps now store keys, so that is fixed. There is still some of the std::HashMap API that's not implemented---for example the Entry API---so I wouldn't say that these maps are a drop in replacement. I'm working on supporting more of the API, but I have limited time and since they are additional features, they are being made as I get time.

The LeapMap also has a modified API to help with concurrent performance, but if you are using the API that is currently available, then that should provide the same functionality as the std::HashMap.

If you run into any problems when using the maps, please create an issue, as the tests can't catch every use case.

Thanks for your interest in the crate, I hope it's good for your use case!