From: Mikko Rasa Date: Mon, 3 Jun 2019 08:22:05 +0000 (+0300) Subject: Use a larger buffer size when transferring pack contents X-Git-Url: http://git.tdb.fi/?a=commitdiff_plain;h=9f7ed91d05f6fc92c2142655b5c815c871d11744;p=libs%2Fdatafile.git Use a larger buffer size when transferring pack contents --- diff --git a/tool/packer.cpp b/tool/packer.cpp index 46dd5d2..56dfa03 100644 --- a/tool/packer.cpp +++ b/tool/packer.cpp @@ -170,12 +170,14 @@ void Packer::create_pack(const string &fn) IO::File out(fn, IO::M_WRITE); out.write(&dir_buffer[0], base_offset); tmp_file->seek(0, IO::S_BEG); + unsigned bufsize = 1048576; + char *buf = new char[bufsize]; while(!tmp_file->eof()) { - char buf[16384]; - unsigned len = tmp_file->read(buf, sizeof(buf)); + unsigned len = tmp_file->read(buf, bufsize); if(!len) break; out.write(buf, len); } + delete[] buf; }