diff options
author | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-07-09T13·59-0400 |
---|---|---|
committer | Eelco Dolstra <eelco.dolstra@logicblox.com> | 2012-07-09T13·59-0400 |
commit | 98a423b75aa9061f0164c316f9d2481ce6d5e2f1 (patch) | |
tree | eeff6cf0d5c13e6b93dc0947846e348177066650 /src | |
parent | 425cc612ad4835d29bce081a67ad161d06063b51 (diff) |
prim_import(): prefetch substitute info in parallel using queryMissing()
Diffstat (limited to 'src')
-rw-r--r-- | src/libexpr/primops.cc | 6 |
1 files changed, 6 insertions, 0 deletions
diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 7587dccea4aa..354fc39be073 100644 --- a/src/libexpr/primops.cc +++ b/src/libexpr/primops.cc @@ -51,6 +51,12 @@ static void prim_import(EvalState & state, Value * * args, Value & v) % path % ctx); if (isDerivation(ctx)) try { + /* For performance, prefetch all substitute info. */ + PathSet willBuild, willSubstitute, unknown; + unsigned long long downloadSize, narSize; + queryMissing(*store, singleton<PathSet>(ctx), + willBuild, willSubstitute, unknown, downloadSize, narSize); + /* !!! If using a substitute, we only need to fetch the selected output of this derivation. */ store->buildPaths(singleton<PathSet>(ctx)); |