From ec4278ae949bcd5a73e47448afe404d187d89be2 Mon Sep 17 00:00:00 2001 From: Michael Tremer Date: Sun, 12 Jan 2025 11:27:23 +0000 Subject: [PATCH] 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 --- src/pakfire/archive.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/pakfire/archive.c b/src/pakfire/archive.c index f7822c24e..51e877bbc 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), -- 2.47.3