summaryrefslogtreecommitdiffstats
path: root/src/network/socket
diff options
context:
space:
mode:
authorMarkus Goetz <Markus.Goetz@nokia.com>2009-09-01 14:08:56 (GMT)
committerMarkus Goetz <Markus.Goetz@nokia.com>2009-09-01 14:08:56 (GMT)
commit5632ba903c1b31717b4fabdfc2a3c8b710b5cbf1 (patch)
tree0d14bc78e06a2460586f61d0600a95e97f58b52c /src/network/socket
parent500de752ac6af943ced98cd685ed460457b3166d (diff)
downloadQt-5632ba903c1b31717b4fabdfc2a3c8b710b5cbf1.zip
Qt-5632ba903c1b31717b4fabdfc2a3c8b710b5cbf1.tar.gz
Qt-5632ba903c1b31717b4fabdfc2a3c8b710b5cbf1.tar.bz2
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
Diffstat (limited to 'src/network/socket')
-rw-r--r--src/network/socket/qnativesocketengine.cpp17
1 files 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;