From: Michael Tremer Date: Sun, 12 Jan 2025 11:27:23 +0000 (+0000) Subject: archive: Increase the block size X-Git-Tag: 0.9.30~405 X-Git-Url: http://git.ipfire.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=ec4278ae949bcd5a73e47448afe404d187d89be2;p=pakfire.git archive: Increase the block size This will use a little bit more memory per opened archive, but will make extraction somewhat faster. Extracting the snapshot shrinks from about 25 to 23 seconds on my system. Signed-off-by: Michael Tremer --- diff --git a/src/pakfire/archive.c b/src/pakfire/archive.c index f7822c24..51e877bb 100644 --- a/src/pakfire/archive.c +++ b/src/pakfire/archive.c @@ -58,6 +58,8 @@ // The maximum number of symlinks to follow when reading a file from an archive #define MAX_FOLLOW_SYMLINKS 10 +#define ARCHIVE_READ_BLOCK_SIZE 512 * 1024 + struct pakfire_archive { struct pakfire_ctx* ctx; struct pakfire* pakfire; @@ -93,7 +95,7 @@ struct pakfire_archive_file { FILE* f; // Buffer to store a block of data - char buffer[128 * 1024]; + char buffer[ARCHIVE_READ_BLOCK_SIZE]; enum { PAKFIRE_ARCHIVE_FILE_CANT_SEEK = (1 << 0),