]> git.ipfire.org Git - thirdparty/curl.git/commitdiff
transfer: avoid polling socket every transfer loop
authorStefan Eissing <stefan@eissing.org>
Thu, 4 Jul 2024 09:14:05 +0000 (11:14 +0200)
committerDaniel Stenberg <daniel@haxx.se>
Thu, 4 Jul 2024 21:02:41 +0000 (23:02 +0200)
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

lib/transfer.c

index 4051f6743c784c8507efcf247b5d27a26417f2c8..476f9c002e190e9bfbf22a972e5c3e190344f2ed 100644 (file)
@@ -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