mirror of
https://github.com/NixOS/nix.git
synced 2025-11-09 12:06:01 +01:00
Reduce false sharing between pathInfoCache and Store
`perf c2c` shows a lot of cacheline conflicts between purely read-only Store methods (like `parseStorePath()`) and the Sync classes. So allocate pathInfoCache separately to avoid that.
This commit is contained in:
parent
5ae1b5f88b
commit
a73cf447ac
7 changed files with 37 additions and 63 deletions
|
|
@ -125,11 +125,8 @@ void BinaryCacheStore::writeNarInfo(ref<NarInfo> narInfo)
|
|||
|
||||
upsertFile(narInfoFile, narInfo->to_string(*this), "text/x-nix-narinfo");
|
||||
|
||||
{
|
||||
auto state_(state.lock());
|
||||
state_->pathInfoCache.upsert(
|
||||
std::string(narInfo->path.to_string()), PathInfoCacheValue{.value = std::shared_ptr<NarInfo>(narInfo)});
|
||||
}
|
||||
pathInfoCache->lock()->upsert(
|
||||
std::string(narInfo->path.to_string()), PathInfoCacheValue{.value = std::shared_ptr<NarInfo>(narInfo)});
|
||||
|
||||
if (diskCache)
|
||||
diskCache->upsertNarInfo(
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue