I tried to profile my program, which is a file downloader. I use 5 QNetworkRequestto increase the transmission speed, they all connect to the same slot readyRead().
I use QMap to buffer these byte arrays.
When the download speed reaches, for example, 5 MB / s, I found that CPU costs increased significantly, almost 100%, readyRead()caused 30 times per second.
Are there any suggestions for this, for example, can I let QNetworkReply buffer its io device, reduce the number of emitted signals?
UPDATA
I did some debugging output in the readyReady () file: ( replyhere it was cast from the sender ())
qDebug() << "Got: " << reply->readAll().length() << " bytes";
And about 30 outputs per second, each contains 1,500 bytes
source
share