From: Stefan Eissing Date: Thu, 4 Jul 2024 09:14:05 +0000 (+0200) Subject: transfer: avoid polling socket every transfer loop X-Git-Tag: curl-8_9_0~118 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=b8e098a057caa8cda588209499ff73260f7f819f;p=thirdparty%2Fcurl.git transfer: avoid polling socket every transfer loop Improve download performance, minimal effort. Do not poll the socket for pending data every transfer loop iteration. This gives 10-20% performance gains on large HTTP/1.1 downloads (on my machine). Closes #14098 --- diff --git a/lib/transfer.c b/lib/transfer.c index 4051f6743c..476f9c002e 100644 --- a/lib/transfer.c +++ b/lib/transfer.c @@ -336,7 +336,7 @@ static CURLcode readwrite_data(struct Curl_easy *data, if((k->keepon & KEEP_RECV_PAUSE) || !(k->keepon & KEEP_RECV)) break; - } while(maxloops-- && data_pending(data)); + } while(maxloops--); if((maxloops <= 0) || data_pending(data)) { /* did not read until EAGAIN or there is still pending data, mark as