diff options
author | Markus Goetz <Markus.Goetz@nokia.com> | 2009-07-15 10:40:53 (GMT) |
---|---|---|
committer | Markus Goetz <Markus.Goetz@nokia.com> | 2009-07-17 11:36:17 (GMT) |
commit | 8ab072aff0527d3ef3e44cf1ceba7dca985a6f94 (patch) | |
tree | 6a7a77a5dcea90c00ebc66c735c19af731b042f3 /src/network/access/qnetworkaccessdebugpipebackend.cpp | |
parent | 430f93c3649aacea5d9ccab047f036027f0622ea (diff) | |
download | Qt-8ab072aff0527d3ef3e44cf1ceba7dca985a6f94.zip Qt-8ab072aff0527d3ef3e44cf1ceba7dca985a6f94.tar.gz Qt-8ab072aff0527d3ef3e44cf1ceba7dca985a6f94.tar.bz2 |
QNetworkAccessManager: HTTP download performance improvements
Better usage of move semantics with implicit sharing to avoid
detaching (=malloc/memcpy). Also some other improvements.
Download performance improvement is around 20% according
to the httpDownloadPerformance autotest.
Reviewed-by: Thiago Macieira
Diffstat (limited to 'src/network/access/qnetworkaccessdebugpipebackend.cpp')
-rw-r--r-- | src/network/access/qnetworkaccessdebugpipebackend.cpp | 6 |
1 files changed, 5 insertions, 1 deletions
diff --git a/src/network/access/qnetworkaccessdebugpipebackend.cpp b/src/network/access/qnetworkaccessdebugpipebackend.cpp index 54fcddd..2b3c128 100644 --- a/src/network/access/qnetworkaccessdebugpipebackend.cpp +++ b/src/network/access/qnetworkaccessdebugpipebackend.cpp @@ -155,7 +155,11 @@ void QNetworkAccessDebugPipeBackend::pushFromSocketToDownstream() // have read something buffer.resize(haveRead); bytesDownloaded += haveRead; - writeDownstreamData(buffer); + + QByteDataBuffer list; + list.append(buffer); + buffer.clear(); // important because of implicit sharing! + writeDownstreamData(list); } } } |