inputfile: Increase chunk size from 16KB to 4MB.
authorUwe Hermann <uwe@hermann-uwe.de>
Sat, 14 Apr 2018 20:23:52 +0000 (22:23 +0200)
committerUwe Hermann <uwe@hermann-uwe.de>
Sun, 15 Apr 2018 15:11:51 +0000 (17:11 +0200)
Use a 4MB chunk size for reading a file into memory. Larger values don't
seem to provide any substancial performance improvements, but can cause
UI lag and a visually "stuttering" display of the data currently loading.

pv/devices/inputfile.cpp

index 1bf34bad22a33bc0307199657bfe5ecf8dc9ef3d..4ffd2dfa22cbc702d6ad7dfeb476042ec2d73639 100644 (file)
@@ -36,7 +36,10 @@ using std::vector;
 namespace pv {
 namespace devices {
 
-const streamsize InputFile::BufferSize = 16384;
+// Use a 4MB chunk size for reading a file into memory. Larger values don't
+// seem to provide any substancial performance improvements, but can cause
+// UI lag and a visually "stuttering" display of the data currently loading.
+const streamsize InputFile::BufferSize = (4 * 1024 * 1024);
 
 InputFile::InputFile(const shared_ptr<sigrok::Context> &context,
        const string &file_name,