Explore using Dictionary synchronized with SemaphoreSlim instead of ConcurrentDictionary for holding clients.
tpeczek opened this issue · 1 comments
tpeczek commented
In same cases ConcurrentDictionary
can be slow and blocking, so (after careful measurement) it might be worth to replace it with regular Dictionary
synchronized with help of SemaphoreSlim
.
- Prepare simple benchmark for adding clients
- Prepare concurrent benchmark for adding clients
- Replace
ConcurrentDictionary
withSemaphoreSlim
synchronizedDictionary
and compare results
tpeczek commented
After measurements, the implementation will remain based on ConcurrentDictionary
.