Home

Awesome

Benchmarks for the AsyncKeyedLock library

This is a project to help benchmark the AsyncKeyedLock library against other competing solutions. We are testing with 3 separate parameters:

  1. Number of locks: 200 and 10000
  2. Contention: 100 and 10000
  3. GUID reversals (to simulate some load): 0, 1 and 5

When looking at the benchmarks, please ignore all values for 10k locks with 10k contention: they are dummy tests and don't actually run.

Solutions tested

  1. AsyncKeyedLocker with pooling (from AsyncKeyedLock)
  2. AsyncKeyedLocker without pooling (from AsyncKeyedLock)
  3. StripedAsyncKeyedLocker (from AsyncKeyedLock)
  4. AsyncKeyLock from ImageSharp.Web
  5. AsyncKeyLock by usercode
  6. KeyedSemaphoresCollection from Keyed Semaphores, similar to StripedAsyncKeyedLocker
  7. KeyedSemaphoresDictionary from Keyed Semaphores, similar to AsyncKeyedLocker without pooling
  8. AsyncDuplicateLock from Stephen Cleary's StackOverflow solution
  9. AsyncDuplicateLock from Theodor Zoulias' improvement over #8
  10. StripedAsyncLock from AsyncUtilities, similar to StripedAsyncKeyedLocker
  11. NeoSmart.Synchronization
  12. Dao.IndividualLock
  13. AsyncLockSet from Stl.Fusion

Results

The benchmark results can be found in our actions as they run in Github Actions, in a fully transparent fashion.

There are also some graphical comparisons over time.