1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-25 10:41:16 +02:00

Merge pull request #12238 from apoelstra/2025-01--unsorted-gc

gc: replace ordered sets with unordered sets for in-memory caches
This commit is contained in:
Eelco Dolstra 2025-01-13 13:33:12 +01:00 committed by GitHub
commit a78f998cc7
No known key found for this signature in database
GPG key ID: B5690EEEBB952194

View file

@ -455,7 +455,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results)
bool gcKeepOutputs = settings.gcKeepOutputs; bool gcKeepOutputs = settings.gcKeepOutputs;
bool gcKeepDerivations = settings.gcKeepDerivations; bool gcKeepDerivations = settings.gcKeepDerivations;
StorePathSet roots, dead, alive; std::unordered_set<StorePath> roots, dead, alive;
struct Shared struct Shared
{ {
@ -661,7 +661,7 @@ void LocalStore::collectGarbage(const GCOptions & options, GCResults & results)
} }
}; };
std::map<StorePath, StorePathSet> referrersCache; std::unordered_map<StorePath, StorePathSet> referrersCache;
/* Helper function that visits all paths reachable from `start` /* Helper function that visits all paths reachable from `start`
via the referrers edges and optionally derivers and derivation via the referrers edges and optionally derivers and derivation