53 releases (stable)

5.0.37 Sep 8, 2024
5.0.33 Nov 11, 2023
5.0.27 Jul 26, 2023
5.0.12 Mar 26, 2023
0.0.13 Nov 13, 2022

#49 in Concurrency

Download history 108/week @ 2024-08-22 434/week @ 2024-08-29 322/week @ 2024-09-05 258/week @ 2024-09-12 172/week @ 2024-09-19 169/week @ 2024-09-26 371/week @ 2024-10-03 35080/week @ 2024-10-10 16842/week @ 2024-10-17 10632/week @ 2024-10-24 9548/week @ 2024-10-31 10467/week @ 2024-11-07 11531/week @ 2024-11-14 9973/week @ 2024-11-21 7119/week @ 2024-11-28 10269/week @ 2024-12-05

41,140 downloads per month
Used in 10 crates (2 directly)

MIT/Apache

96KB
1.5K SLoC

concurrent-map

Lock-free linearizable map.

  • get, insert, cas, remove, iter, range, get_gt, get_gte, get_lt, get_lte, first, last, pop_first, pop_last
  • fully lock-free node splits and merges based on the sled battle-tested implementation. concurrent-map can be though of in some ways as a simplified, in-memory sled that supports high-level types.
  • initially designed for use in sled's next generation object store, marble.

The ConcurrentMap allows users to tune the tree fan-out (FANOUT) and the underlying memory reclamation granularity (LOCAL_GC_BUFFER_SIZE) for achieving desired performance properties. The defaults are pretty good for most use cases but if you want to squeeze every bit of performance out for your particular workload, tweaking them based on realistic measurements may be beneficial. See the ConcurrentMap docs for more details.

If you want to use a custom key type, you must implement the Minimum trait, allowing the left-most side of the tree to be created before inserting any data.

This is an ordered data structure, and supports very high throughput iteration over lexicographically sorted ranges of values. If you are looking for simple point operation performance, you may find a better option among one of the many concurrent hashmap implementations that are floating around. Pay for what you actually use :)

The minimum supported rust version (MSRV) is 1.70.

Dependencies

~0.4–5MB
~17K SLoC