createrepo_c/0005-Set-compression-level-for-zstd-to-level-10.patch
Aleš Matěj cc4d2c3ef6 Add zstd compression support
Resolves: RHEL-67689

Specifies git VCS for `%autosetup` because zstd tests contain binary
data and their patch cannot be applied by the `patch` tool which is used
by default.
2025-03-10 09:55:29 +01:00

38 lines
1.2 KiB
Diff

From 84cdfec03f8adfd891227cd2e44b744d0b55b2ff Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?Dirk=20M=C3=BCller?= <dirk@dmllr.de>
Date: Wed, 8 Nov 2023 23:31:44 +0100
Subject: [PATCH 4/4] Set compression level for zstd to level 10
This requires a good amount of saving due to larger dictionary
size with only marginal more time effort for compression. decompression
time is unaffected.
---
src/compression_wrapper.c | 11 ++++++++++-
1 file changed, 10 insertions(+), 1 deletion(-)
diff --git a/src/compression_wrapper.c b/src/compression_wrapper.c
index af06543..175806a 100644
--- a/src/compression_wrapper.c
+++ b/src/compression_wrapper.c
@@ -122,7 +122,16 @@ typedef struct {
} XzFile;
#ifdef WITH_ZSTD
-#define CR_CW_ZSTD_COMPRESSION_LEVEL 9
+
+/** level 10 or 11 are good choices for the XML files that we generate.
+ * level 10 requires ~ 18% more time with 1% saving over level 9
+ * level 11 requires ~ 50% more time with 1.5% saving over level 9
+ * level 12 requires ~ 65% more time with 1.5% saving over level 9
+ * level 13 requires ~ 260% more time with 1.55% saving over level 9
+*/
+
+#define CR_CW_ZSTD_COMPRESSION_LEVEL 10
+
typedef struct {
void *buffer;
size_t buffer_size;
--
2.48.1