From 2176c939fca52c5a8a816346e7376346324f1dc8 Mon Sep 17 00:00:00 2001 From: Eelco Dolstra Date: Thu, 10 Nov 2016 17:30:12 +0100 Subject: [PATCH] Compute FS closures in parallel This is much faster. --- default.nix | 2 +- generate-programs-index.cc | 6 ++---- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/default.nix b/default.nix index a0049e2..89d773a 100644 --- a/default.nix +++ b/default.nix @@ -5,7 +5,7 @@ with pkgs; let # FIXME - nix = builtins.storePath /nix/store/b554awsd9vssb936mb32icgpfbyifsai-nix-1.12pre1234_abcdef; + nix = builtins.storePath /nix/store/cvrdgdx0gzdi0yf2831f4j98d518m3ln-nix-1.12pre1234_abcdef; #lib.overrideDerivation nixUnstable (orig: { # src = /home/eelco/Dev/nix; #}); diff --git a/generate-programs-index.cc b/generate-programs-index.cc index 5d27350..74507b5 100644 --- a/generate-programs-index.cc +++ b/generate-programs-index.cc @@ -69,7 +69,7 @@ void mainWrapped(int argc, char * * argv) auto localStore = openStore(); std::string binaryCacheUri = argv[3]; if (hasSuffix(binaryCacheUri, "/")) binaryCacheUri.pop_back(); - auto binaryCache = openStoreAt(binaryCacheUri); + auto binaryCache = openStore(binaryCacheUri); struct CacheState { @@ -83,9 +83,7 @@ void mainWrapped(int argc, char * * argv) auto allowedPaths = tokenizeString(readFile(storePathsFile, true)); PathSet allowedPathsClosure; - for (auto & path : allowedPaths) - if (!allowedPathsClosure.count(path)) - binaryCache->computeFSClosure(path, allowedPathsClosure); + binaryCache->computeFSClosure(allowedPaths, allowedPathsClosure); printMsg(lvlInfo, format("%d top-level paths, %d paths in closure") % allowedPaths.size() % allowedPathsClosure.size());