From: Uwe Hermann Date: Sat, 14 Apr 2018 20:23:52 +0000 (+0200) Subject: inputfile: Increase chunk size from 16KB to 4MB. X-Git-Url: https://sigrok.org/gitweb/?p=pulseview.git;a=commitdiff_plain;h=1f419596224bd8f73fc8c59b52b8775685249a07;hp=3b0acbcbcd902ac61a3841e7c558cbc5f8448b7f inputfile: Increase chunk size from 16KB to 4MB. 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. --- diff --git a/pv/devices/inputfile.cpp b/pv/devices/inputfile.cpp index 1bf34bad..4ffd2dfa 100644 --- a/pv/devices/inputfile.cpp +++ b/pv/devices/inputfile.cpp @@ -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 &context, const string &file_name,