1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-07-06 05:01:48 +02:00

make multi threaded compression configurable and use single threaded

by default.
This commit is contained in:
AmineChikhaoui 2018-02-07 17:54:08 +01:00
parent 163e39547a
commit 55ecdfe2a8
No known key found for this signature in database
GPG key ID: C0C8C84C15BCCD1C
4 changed files with 31 additions and 20 deletions

View file

@ -149,7 +149,7 @@ void BinaryCacheStore::addToStore(const ValidPathInfo & info, const ref<std::str
/* Compress the NAR. */
narInfo->compression = compression;
auto now1 = std::chrono::steady_clock::now();
auto narCompressed = compress(compression, *nar);
auto narCompressed = compress(compression, *nar, settings.parallelCompression);
auto now2 = std::chrono::steady_clock::now();
narInfo->fileHash = hashString(htSHA256, *narCompressed);
narInfo->fileSize = narCompressed->size();

View file

@ -174,6 +174,9 @@ public:
"Whether to compress logs.",
{"build-compress-log"}};
Setting<bool> parallelCompression{this, false, "parallel-compression",
"Whether to enable parallel compression, only supported with xz currently"};
Setting<unsigned long> maxLogSize{this, 0, "max-build-log-size",
"Maximum number of bytes a builder can write to stdout/stderr "
"before being killed (0 means no limit).",