Skip to content

Choosing a concurrent map #113

Closed Answered by wvwwvwwv
maxcountryman asked this question in Q&A
Discussion options

You must be logged in to vote

Hi!

Nice to hear that you're considering this crate for your project.

So, first and foremost, I'd like to start with dashmap's sharding vs the fine-grained locking mechanism in scc::HashMap. From my understanding, the number of shards in a dashmap instance is determined at runtime by querying the number of cores in the system; say, if the system has 32 CPU cores, the number of shards will be 32, and the number of locks in the dashmap instance is fixed to 32. On the other hand, the number of locks in a scc::HashMap instance is not fixed, and relates to the number of entries in it; you can approximate it by expected number of entries * 2 / 32 where 2 comes from the fact that the average loa…

Replies: 1 comment 8 replies

Comment options

You must be logged in to vote
8 replies
@x1957
Comment options

@wvwwvwwv
Comment options

@x1957
Comment options

@wvwwvwwv
Comment options

@x1957
Comment options

Answer selected by wvwwvwwv
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants