xacrimon
Re:Dashmap: Fast concurrent HashMap for Rust
on Friday March 27, 2020 @04:12PM (#22706364)
The Contrie library is in the benchmarks and is a port. That said referring the note in the repo the benchmarks arent 100% scientific atm and will be revamped later this year.
Re:Dashmap: Fast concurrent HashMap for Rust
on Friday March 27, 2020 @04:10PM (#22706342)
Hey! I do know what the issue is I think and it is something that will be resolved with v4 releasing later this year.
It's an atomic architecture specific thing.
Re:Dashmap: Fast concurrent HashMap for Rust
on Friday March 27, 2020 @10:53AM (#22703269)
Hi! I am the author of dashmap. CHashMap is essentially a table behind an rwlock where each slot is also behind its own rwlock. This is great in theory since it allows decently concurrent operations providing they don't need to lock the whole table for resizing. In practice this falls short quickly because of the contention on the outer lock and the large amount of locks and unlocks when traversing the map.
dashmap works by splitting into an array of shards, each shard behind its own rwlock. The shard is decided from the keys hash. This will only lock and unlock once for any one shard and allows concurrent table locking operations provided they are on different shards. Further, there is no central rwlock each thread must go thru which improves performance significantly.