From 98a423b75aa9061f0164c316f9d2481ce6d5e2f1 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Mon, 9 Jul 2012 09:59:34 -0400 Subject: [PATCH] prim_import(): prefetch substitute info in parallel using queryMissing() --- src/libexpr/primops.cc | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/libexpr/primops.cc b/src/libexpr/primops.cc index 7587dccea..354fc39be 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(ctx), + willBuild, willSubstitute, unknown, downloadSize, narSize); + /* !!! If using a substitute, we only need to fetch the selected output of this derivation. */ store->buildPaths(singleton(ctx));