You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository was archived by the owner on Dec 14, 2018. It is now read-only.
It may be possible to significantly improve the performance of MemoryCache by using ConcurrentDictionary rather than Dictionary protected by a ReaderWriterLockSlim. Under high load, there is contention acquiring the read lock from ReaderWriterLockSlim.
I created a quick prototype which shows significantly improved performance, though it may not be functionally correct in all scenarios.
Scenario
MemoryCache Implementation
RPS
CPU
Plaintext
N/A
1,167,369
100%
MemoryCachePlaintext
ReaderWriterLockSlim
342,129
60%
MemoryCachePlaintext
ConcurrentDictionary
802,076
100%
The remaining work is to improve and test the ConcurrentDictionary implementation to ensure it's correct under high load, has no race conditions, etc.