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

[SharedCache] Remove unnecessary lock in SharedCache destructor #6194

Merged

Conversation

WeiN76LQh
Copy link

From what I can tell the lock being taken in SharedCache::~SharedCache was purely for the decrement of sharedCacheReferences, however its an atomic so a lock isn't necessary. The lock being taken is extremely contentious and therefore often slow to be acquired. This resulted in a surprising amount of execution time spent in the SharedCache destructor. Nothing hugely significant but a quick and easy win to remove this single line of code.

@plafosse plafosse added this to the Gallifrey milestone Dec 4, 2024
@plafosse plafosse added the File Format: SharedCache Issue with the dyld_shared_cache plugin label Dec 10, 2024
@0cyn
Copy link
Member

0cyn commented Dec 10, 2024

Thanks for the PR! I'll look at getting this merged sometime this week.

From what I can tell the lock being taken in `SharedCache::~SharedCache` was purely for the decrement of `sharedCacheReferences`, however its an atomic so a lock isn't necessary. The lock being taken is extremely contentious and therefore often slow to be acquired. This resulted in a surprising amount of execution time spent in the `SharedCache` destructor. Nothing hugely significant but a quick and easy win to remove this single line of code.
@0cyn 0cyn force-pushed the sharedcache-destructor-performance-improvement branch from ec5a0e1 to 08d91f1 Compare December 26, 2024 13:25
@0cyn 0cyn merged commit 08d91f1 into Vector35:dev Dec 26, 2024
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
File Format: SharedCache Issue with the dyld_shared_cache plugin
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants