Details
-
Suggestion
-
Resolution: Unresolved
-
P4: Low
-
None
-
5.9, 5.14.2
Description
The Valgrind profiler shows that 71% of time in QAbstractSocket::waitForReadyRead() is spent for QNativeSocketEnginePrivate::setError() in case a timeout occurs.
I think it's quite a lot for a function that only sets the error code and name.
Measured code:
// Code in QThread::run() QEventLoop eventLoop; QTcpSocket *socket = new QTcpSocket(); // connect ... // wait for data ... while (!socket->waitForReadyRead(10)) { // wait 10 msecs // ... while (eventLoop.processEvents(QEventLoop::ExcludeSocketNotifiers)) { } } // read data ...