1
1
Fork 0
mirror of https://github.com/NixOS/nix.git synced 2025-11-21 09:49:36 +01:00

Merge pull request #13932 from NixOS/move-pathInfoCache

Reduce false sharing between pathInfoCache and Store
This commit is contained in:
Jörg Thalheim 2025-09-10 09:56:46 +02:00 committed by GitHub
commit 9c186c35fa
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
7 changed files with 37 additions and 63 deletions

View file

@ -722,12 +722,8 @@ uint64_t LocalStore::addValidPath(State & state, const ValidPathInfo & info, boo
}
}
{
auto state_(Store::state.lock());
state_->pathInfoCache.upsert(
std::string(info.path.to_string()),
PathInfoCacheValue{.value = std::make_shared<const ValidPathInfo>(info)});
}
pathInfoCache->lock()->upsert(
std::string(info.path.to_string()), PathInfoCacheValue{.value = std::make_shared<const ValidPathInfo>(info)});
return id;
}
@ -1022,10 +1018,7 @@ void LocalStore::invalidatePath(State & state, const StorePath & path)
/* Note that the foreign key constraints on the Refs table take
care of deleting the references entries for `path'. */
{
auto state_(Store::state.lock());
state_->pathInfoCache.erase(std::string(path.to_string()));
}
pathInfoCache->lock()->erase(std::string(path.to_string()));
}
const PublicKeys & LocalStore::getPublicKeys()