Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Switched lock provider to a more performant library #226

Merged
merged 1 commit into from
Jan 24, 2024

Conversation

MarkCiliaVincenti
Copy link
Contributor

Disclaimer: I am the author of the new library.

Public benchmarks running on GitHub show AsyncNonKeyedLocker to be considerably more performant; in tests NeoSmart.AsyncLock took 9.71x the time and allocated 7.42x the memory.

https://github.com/MarkCiliaVincenti/AsyncNonKeyedLockBenchmarks/actions/runs/7526873065/job/20485876144

Copy link

what-the-diff bot commented Jan 24, 2024

PR Summary

  • New Package Added
    The project file EFCoreSecondLevelCacheInterceptor.csproj now includes a reference to the new package AsyncKeyedLock. This package enhances the asynchronous locking capabilities in our existing code.

  • Updated Interface
    The ILockProvider.cs interface has been updated to include a newly utilized element from our new package, AsyncKeyedLock.

  • Changes in ILockProvider Interface's Methods
    The Lock and LockAsync methods in the ILockProvider interface now return AsyncNonKeyedLockReleaser instead of IDisposable. This change enhances the ability of these methods to release asynchronous locks and makes them more efficient.

  • Upgrades in LockProvider Class
    The LockProvider class has been updated to use AsyncNonKeyedLocker instead of AsyncLock, promoting better management of asynchronous operations. The Lock and LockAsync methods in the LockProvider class have been upgraded in a similar fashion to their counterparts in the ILockProvider interface. Additionally, a new Dispose method has been added for the correct disposal of the lock when it's no longer in use.

@VahidN
Copy link
Owner

VahidN commented Jan 24, 2024

Thank you.

@VahidN VahidN merged commit 442d20a into VahidN:master Jan 24, 2024
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants