diff options
author | Denis Shienkov <denis.shienkov@gmail.com> | 2017-04-12 10:03:37 +0300 |
---|---|---|
committer | Denis Shienkov <denis.shienkov@gmail.com> | 2017-04-26 06:47:34 +0000 |
commit | a5ecc626bc6cf4e0890150acabcbff3a8d9af871 (patch) | |
tree | 2a3eb29fb73b63219904207c0eac6dd5da7df137 /src/serialport/qserialport.cpp | |
parent | aa1ab248bd3dad450caabb445cd71874048d75b3 (diff) | |
download | qtserialport-a5ecc626bc6cf4e0890150acabcbff3a8d9af871.tar.gz |
Increase buffer chunk sizes
This reduces the number of syscalls and thus the CPU load when dealing
with fast ports. And 32KiB seems still small enough to be no concern on
modern hardware even if it's excessive for a given port.
Change-Id: I4749e4255627d3abf2393323216e01ac6436413b
Reviewed-by: Alex Trotsenko <alex1973tr@gmail.com>
Reviewed-by: Oswald Buddenhagen <oswald.buddenhagen@qt.io>
Reviewed-by: Denis Shienkov <denis.shienkov@gmail.com>
Diffstat (limited to 'src/serialport/qserialport.cpp')
-rw-r--r-- | src/serialport/qserialport.cpp | 5 |
1 files changed, 3 insertions, 2 deletions
diff --git a/src/serialport/qserialport.cpp b/src/serialport/qserialport.cpp index fa780f3..65fcfbb 100644 --- a/src/serialport/qserialport.cpp +++ b/src/serialport/qserialport.cpp @@ -101,7 +101,7 @@ QSerialPortPrivate::QSerialPortPrivate() , isBreakEnabled(false) #if defined(Q_OS_WIN32) , handle(INVALID_HANDLE_VALUE) - , readChunkBuffer(ReadChunkSize, 0) + , readChunkBuffer(QSERIALPORT_BUFFERSIZE, 0) , communicationStarted(false) , writeStarted(false) , readStarted(false) @@ -121,7 +121,8 @@ QSerialPortPrivate::QSerialPortPrivate() , writeSequenceStarted(false) #endif { - writeBufferChunkSize = InitialBufferSize; + writeBufferChunkSize = QSERIALPORT_BUFFERSIZE; + readBufferChunkSize = QSERIALPORT_BUFFERSIZE; } void QSerialPortPrivate::setError(const QSerialPortErrorInfo &errorInfo) |