Update chunkSize to the suggested value

This was a suggested course of action in a review in one of our earlier
commits, https://github.com/NixOS/nix/pull/3801#discussion_r457557079
This commit is contained in:
Carlo Nucera 2020-07-21 10:24:19 -04:00
parent 0835447eaa
commit 922a845ffc

View file

@ -1069,7 +1069,7 @@ StorePath LocalStore::addToStoreFromDump(Source & source0, const string & name,
or the original source is empty */ or the original source is empty */
while (dump.size() < settings.narBufferSize) { while (dump.size() < settings.narBufferSize) {
auto oldSize = dump.size(); auto oldSize = dump.size();
constexpr size_t chunkSize = 1024; constexpr size_t chunkSize = 65536;
auto want = std::min(chunkSize, settings.narBufferSize - oldSize); auto want = std::min(chunkSize, settings.narBufferSize - oldSize);
dump.resize(oldSize + want); dump.resize(oldSize + want);
auto got = 0; auto got = 0;