tpeczek/Lib.AspNetCore.ServerSentEvents

Explore using Dictionary synchronized with SemaphoreSlim instead of ConcurrentDictionary for holding clients.

tpeczek opened this issue · 1 comments

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 with SemaphoreSlim synchronized Dictionary and compare results

After measurements, the implementation will remain based on ConcurrentDictionary.