I tried to profiling my program, which is a file downloader. I use 5 QNetworkRequest
to enhance transfer speed, they all connect to the same readyRead()
slot.
I use QMap to buffer those byte arrays.
When downloading speed reaches, e.g 5 MiB/s, I found CPU costs rises up significantly, nearly 100%, readyRead()
was calling 30 times per seconds.
Is there any suggestion to this, e.g can I let QNetworkReply buffer its io device, reduce the amount of signals emitted?
UPDATA
I made some debug output in readyReady():
(reply
here was casted from sender())
qDebug() << "Got: " << reply->readAll().length() << " bytes";
And about 30 output per seconds , each contains 1500 bytes