From 5632ba903c1b31717b4fabdfc2a3c8b710b5cbf1 Mon Sep 17 00:00:00 2001 From: Markus Goetz Date: Tue, 1 Sep 2009 16:08:56 +0200 Subject: Socket code: Do not use magic buffer size value I have seen a performance increase of around 30% for big file transfers on Linux when having high bandwidth and higher latency. Reviewed-by: Thiago --- src/network/socket/qnativesocketengine.cpp | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/network/socket/qnativesocketengine.cpp b/src/network/socket/qnativesocketengine.cpp index 3e56995..3d9aa61 100644 --- a/src/network/socket/qnativesocketengine.cpp +++ b/src/network/socket/qnativesocketengine.cpp @@ -389,10 +389,19 @@ bool QNativeSocketEngine::initialize(QAbstractSocket::SocketType socketType, QAb qWarning("QNativeSocketEngine::initialize unable to inline out-of-band data"); } - // Set the send and receive buffer sizes to a magic size, found - // most optimal for our platforms. - setReceiveBufferSize(49152); - setSendBufferSize(49152); + // Before Qt 4.6, we always set the send and receive buffer size to 49152 as + // this was found to be an optimal value. However, modern OS + // all have some kind of auto tuning for this and we therefore don't set + // this explictly anymore. + // If it introduces any performance regressions for Qt 4.6.x (x > 0) then + // it will be put back in. + // + // You can use tests/manual/qhttpnetworkconnection to test HTTP download speed + // with this. + // + // pre-4.6: + // setReceiveBufferSize(49152); + // setSendBufferSize(49152); d->socketType = socketType; d->socketProtocol = protocol; -- cgit v0.12