From 08d91f14061c54134038fadc2d333a3aa3da0fe1 Mon Sep 17 00:00:00 2001 From: WeiN76LQh Date: Mon, 25 Nov 2024 16:04:33 +0000 Subject: [SharedCache] Remove unnecessary lock in `SharedCache` destructor 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. --- view/sharedcache/core/SharedCache.cpp | 1 - 1 file changed, 1 deletion(-) (limited to 'view/sharedcache/core/SharedCache.cpp') diff --git a/view/sharedcache/core/SharedCache.cpp b/view/sharedcache/core/SharedCache.cpp index e4d4ef11..7bbacf63 100644 --- a/view/sharedcache/core/SharedCache.cpp +++ b/view/sharedcache/core/SharedCache.cpp @@ -1424,7 +1424,6 @@ SharedCache::SharedCache(BinaryNinja::Ref dscView) : m_ } SharedCache::~SharedCache() { - std::unique_lock lock(viewSpecificMutexes[m_dscView->GetFile()->GetSessionId()].viewOperationsThatInfluenceMetadataMutex); sharedCacheReferences--; } -- cgit v1.3.1