diff options
author | Eelco Dolstra <edolstra@gmail.com> | 2017-03-16T11·05+0100 |
---|---|---|
committer | Eelco Dolstra <edolstra@gmail.com> | 2017-03-16T11·05+0100 |
commit | 91d67692cfb05e4ece744fb9d144921ae920f2de (patch) | |
tree | aca2fa194fe0bc652ed9b6e87220dd528f97dde5 /src/libstore/store-api.cc | |
parent | ea7fa88131eb486ffe54f32601d36a64374f7b7c (diff) |
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.
Diffstat (limited to 'src/libstore/store-api.cc')
-rw-r--r-- | src/libstore/store-api.cc | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/src/libstore/store-api.cc b/src/libstore/store-api.cc index 9c755965e45b..9ab3f36329b4 100644 --- a/src/libstore/store-api.cc +++ b/src/libstore/store-api.cc @@ -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; }, |