Crate clashmap

Source
Expand description

§ClashMap

Conrad Ludgate’s Dashmap Fork: Removes much of the unsafe from dashmap, and improves on the API

Sharded hashmap suitable for fast concurrent access.

ClashMap is an implementation of a concurrent associative array/hashmap in Rust.

ClashMap tries to implement an easy to use API similar to std::collections::HashMap with some slight changes to handle concurrency.

ClashMap tries to be very simple to use and to be a direct replacement for RwLock<HashMap<K, V>>. To accomplish these goals, all methods take &self instead of modifying methods taking &mut self. This allows you to put a ClashMap in an Arc<T> and share it between threads while still being able to modify it.

ClashMap puts great effort into performance and aims to be as fast as possible. If you have any suggestions or tips do not hesitate to open an issue or a PR.

version

documentation

downloads

minimum rustc version

§Cargo features

  • serde - Enables serde support.

  • raw-api - Enables the unstable raw-shard api.

  • rayon - Enables rayon support.

  • inline - Enables inline-more feature from the hashbrown crate. Can lead to better performance, but with the cost of longer compile-time.

§Contributing

ClashMap gladly accepts contributions! Do not hesitate to open issues or PR’s.

I will take a look as soon as I have time for it.

§Performance

A comprehensive benchmark suite, not yet including ClashMap, can be found here. As of the time of writing this, clashmap@1.0.0 is equivalent in performance to dashmap@6.1.0.

§Special thanks

§License

This project is licensed under MIT.

Re-exports§

pub use mapref::entry::Entry;
pub use mapref::entry::OccupiedEntry;
pub use mapref::entry::VacantEntry;
pub use mapref::entry_ref::EntryRef;
pub use mapref::entry_ref::VacantEntryRef;

Modules§

iter
iter_set
mapref
rayon
setref
tableref
try_result

Structs§

ClashCollection
An implementation detail of ClashTable, exposed for convenience.
ClashMap
ClashMap is an implementation of a concurrent associative array/hashmap in Rust.
ClashSet
ClashSet is a thin wrapper around ClashMap using () as the value type. It uses methods and types which are more convenient to work with on a set.
ClashTable
ClashTable is an implementation of a concurrent hashtable in Rust.
RawRwLock
ReadOnlyView
A read-only view into a ClashMap. Allows to obtain raw references to the stored values.
TryReserveError

Type Aliases§

RwLock