]> git.tdb.fi Git - libs/datafile.git/commitdiff
Use a larger buffer size when transferring pack contents
authorMikko Rasa <tdb@tdb.fi>
Mon, 3 Jun 2019 08:22:05 +0000 (11:22 +0300)
committerMikko Rasa <tdb@tdb.fi>
Mon, 3 Jun 2019 08:22:05 +0000 (11:22 +0300)
tool/packer.cpp

index 46dd5d242ffc652cf9547bf7eb68bb76bb946a19..56dfa0334fb3a93fecad03f77a6a763cb3fb39c1 100644 (file)
@@ -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;
 }