copyPaths(): Don't query path info for a path the target already has
For example, this cuts "nix-copy-closure --from" on a NixOS system closure from 15.9s to 0.5s.
This commit is contained in:
@@ -822,6 +822,7 @@ void copyPaths(ref<Store> from, ref<Store> to, const Paths & storePaths, bool su
|
||||
PathSet(storePaths.begin(), storePaths.end()),
|
||||
|
||||
[&](const Path & storePath) {
|
||||
if (to->isValidPath(storePath)) return PathSet();
|
||||
return from->queryPathInfo(storePath)->references;
|
||||
},
|
||||
|
||||
|
||||
Reference in New Issue
Block a user