Wsm2110 / Faster.Map

Faster.Map is a high-performance, thread-safe key-value store designed to outperform the standard Dictionary and ConcurrentDictionary
MIT License
75 stars 7 forks source link

[Question] What about the thread safety #5

Closed dadhi closed 2 years ago

dadhi commented 2 years ago

Generally, I am interested in your implementation, because I was trying to implement concurrent open-addressed map in the past (and failed).

As I understood, it is not thread-safe variants?

Btw, how it compares to the DictionarySlim?

Wsm2110 commented 2 years ago

These hashmaps were not made with concurrency in mind, hence they work fine (wont throw collection modified exceptions) none the less they should'nt be used in situations were concurrency is key. I might add one in the near future, need to do some research on cas and kcas first.

DictionarySlim still uses chaining which results in alot of cpu cache misses. I wont expect much from this, but ill add some benchmarks this week

dadhi commented 2 years ago

Thanks for clarifying. Immediately want to re-try out my old experiments. Interesting that I did not use Robinhood probing and instead was trying approaches from here https://probablydance.com/2017/02/26/i-wrote-the-fastest-hashtable

Wsm2110 commented 2 years ago

This hashmap originated from probablydance and is using all tips and tricks :) , mind a few tweaks of my own

Wsm2110 commented 1 year ago

DictionarySlim added to benchmarks