2020-07-04 18:10:33 +00:00
|
|
|
# DashMap
|
2019-08-25 17:53:35 +00:00
|
|
|
|
2019-08-26 18:20:31 +00:00
|
|
|
Blazingly fast concurrent map in Rust.
|
|
|
|
|
2019-12-06 15:10:52 +00:00
|
|
|
DashMap is an implementation of a concurrent associative array/hashmap in Rust.
|
|
|
|
|
|
|
|
DashMap tries to implement an easy to use API similar to `std::collections::HashMap`
|
|
|
|
with some slight changes to handle concurrency.
|
|
|
|
|
|
|
|
DashMap tries to be very simple to use and to be a direct replacement for `RwLock<HashMap<K, V>>`.
|
2021-11-16 15:30:02 +00:00
|
|
|
To accomplish these goals, all methods take `&self` instead of modifying methods taking `&mut self`.
|
|
|
|
This allows you to put a DashMap in an `Arc<T>` and share it between threads while still being able to modify it.
|
2019-12-06 15:10:52 +00:00
|
|
|
|
|
|
|
DashMap 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.
|
|
|
|
|
2019-08-29 15:31:25 +00:00
|
|
|
[![version](https://img.shields.io/crates/v/dashmap)](https://crates.io/crates/dashmap)
|
2019-08-26 18:20:31 +00:00
|
|
|
|
2020-08-16 11:29:48 +00:00
|
|
|
[![documentation](https://docs.rs/dashmap/badge.svg)](https://docs.rs/dashmap)
|
|
|
|
|
2019-08-29 15:36:03 +00:00
|
|
|
[![downloads](https://img.shields.io/crates/d/dashmap)](https://crates.io/crates/dashmap)
|
2019-08-26 18:20:31 +00:00
|
|
|
|
2023-08-29 21:12:11 +00:00
|
|
|
[![minimum rustc version](https://img.shields.io/badge/rustc-1.65-orange.svg)](https://crates.io/crates/dashmap)
|
2020-08-11 14:24:01 +00:00
|
|
|
|
2020-01-14 18:34:03 +00:00
|
|
|
## Cargo features
|
|
|
|
|
|
|
|
- `serde` - Enables serde support.
|
|
|
|
|
2020-01-15 00:32:17 +00:00
|
|
|
- `raw-api` - Enables the unstable raw-shard api.
|
|
|
|
|
2020-12-25 23:30:17 +00:00
|
|
|
- `rayon` - Enables rayon support.
|
|
|
|
|
2023-01-20 07:02:09 +00:00
|
|
|
- `inline` - Enables `inline-more` feature from the `hashbrown` crate. Can lead to better performance, but with the cost of longer compile-time.
|
|
|
|
|
2023-07-11 03:20:05 +00:00
|
|
|
- `arbitrary` - Enables support for the `arbitrary` crate.
|
|
|
|
|
2019-12-06 15:10:52 +00:00
|
|
|
## Contributing
|
2019-12-06 15:30:34 +00:00
|
|
|
|
2022-01-18 11:00:44 +00:00
|
|
|
DashMap gladly accepts contributions!
|
2019-12-06 15:10:52 +00:00
|
|
|
Do not hesitate to open issues or PR's.
|
2019-12-06 15:30:34 +00:00
|
|
|
|
2019-12-06 15:10:52 +00:00
|
|
|
I will take a look as soon as I have time for it.
|
2019-12-06 15:30:34 +00:00
|
|
|
|
2020-12-25 23:05:20 +00:00
|
|
|
That said I do not get paid (yet) to work on open-source. This means
|
|
|
|
that my time is limited and my work here comes after my personal life.
|
|
|
|
|
2019-08-26 18:20:31 +00:00
|
|
|
## Performance
|
|
|
|
|
2020-08-12 09:38:19 +00:00
|
|
|
A comprehensive benchmark suite including DashMap can be found [here](https://github.com/xacrimon/conc-map-bench).
|
2019-08-26 18:20:31 +00:00
|
|
|
|
|
|
|
## Special thanks
|
|
|
|
|
2020-03-11 09:11:32 +00:00
|
|
|
- [Jon Gjengset](https://github.com/jonhoo)
|
2019-08-26 18:20:31 +00:00
|
|
|
|
2020-12-26 23:20:29 +00:00
|
|
|
- [Yato](https://github.com/RustyYato)
|
2020-03-11 09:11:32 +00:00
|
|
|
|
|
|
|
- [Karl Bergström](https://github.com/kabergstrom)
|
|
|
|
|
|
|
|
- [Dylan DPC](https://github.com/Dylan-DPC)
|
|
|
|
|
|
|
|
- [Lokathor](https://github.com/Lokathor)
|
|
|
|
|
|
|
|
- [namibj](https://github.com/namibj)
|
2019-08-26 18:20:31 +00:00
|
|
|
|
|
|
|
## License
|
|
|
|
|
|
|
|
This project is licensed under MIT.
|