From 0584ac195c6327cb1e6a3c81adb45afc1f11672a Mon Sep 17 00:00:00 2001 From: Norman Feske Date: Sat, 3 Dec 2022 20:52:32 +0100 Subject: [PATCH] curl: increase maximum write-buffer size The original size of 16K impedes the batched processing of network packets. Changing the value to 256K reduces the number of context switches when downloading large files and thereby improves the throughput by more than 25% (base-hw on qemu_x86_64, using fetchurl to download a file of 100 MiB via the NIC router from lighttpd). Issue #4697 --- repos/libports/ports/curl.hash | 2 +- repos/libports/ports/curl.port | 2 +- repos/libports/src/lib/curl/max_write_size.patch | 12 ++++++++++++ .../lib/curl/{curl_h.patch => no_socketpair.patch} | 0 4 files changed, 14 insertions(+), 2 deletions(-) create mode 100644 repos/libports/src/lib/curl/max_write_size.patch rename repos/libports/src/lib/curl/{curl_h.patch => no_socketpair.patch} (100%) diff --git a/repos/libports/ports/curl.hash b/repos/libports/ports/curl.hash index 36df052458..20e4b9733f 100644 --- a/repos/libports/ports/curl.hash +++ b/repos/libports/ports/curl.hash @@ -1 +1 @@ -ba3c2049149311d614a70359426f5b0a49ea239f +b2103a900cd655abca670fc02d1574be4785585a diff --git a/repos/libports/ports/curl.port b/repos/libports/ports/curl.port index a54184bddb..7e5f6de90d 100644 --- a/repos/libports/ports/curl.port +++ b/repos/libports/ports/curl.port @@ -8,7 +8,7 @@ SIG(curl) := ${URL(curl)}.asc KEY(curl) := daniel@haxx.se DIR(curl) := src/lib/curl -PATCHES := src/lib/curl/curl_h.patch +PATCHES := $(addprefix src/lib/curl/,no_socketpair.patch max_write_size.patch) DIRS := include DIR_CONTENT(include) = src/lib/curl/include/curl diff --git a/repos/libports/src/lib/curl/max_write_size.patch b/repos/libports/src/lib/curl/max_write_size.patch new file mode 100644 index 0000000000..6c5f80a43f --- /dev/null +++ b/repos/libports/src/lib/curl/max_write_size.patch @@ -0,0 +1,12 @@ ++++ src/lib/curl/include/curl/curl.h +@@ -247,6 +247,10 @@ + #define CURL_MAX_WRITE_SIZE 16384 + #endif + ++/* Genode: override the default to foster the batching of network packets */ ++#undef CURL_MAX_WRITE_SIZE ++#define CURL_MAX_WRITE_SIZE 262144 ++ + #ifndef CURL_MAX_HTTP_HEADER + /* The only reason to have a max limit for this is to avoid the risk of a bad + server feeding libcurl with a never-ending header that will cause reallocs diff --git a/repos/libports/src/lib/curl/curl_h.patch b/repos/libports/src/lib/curl/no_socketpair.patch similarity index 100% rename from repos/libports/src/lib/curl/curl_h.patch rename to repos/libports/src/lib/curl/no_socketpair.patch