tools/mkrelease: tweak xz compression parameters

For a generally faster multi-threading compression speed, with only a very minor size increase.
This commit is contained in:
Benoit Pierre authored and Frans de Jonge committed 2026-03-15 23:00:26 +01:00
1 parent 7879e05245
commit a2a9dfe2f7
1 file changed
+6 -1
+6 -1
View File
@@ -306,8 +306,13 @@ case "${format}" in
;;
tar.xz)
echo "Creating archive: ${output}"
# NOTE: override xz default block size, as otherwise with the size of our
# uncompressed data (< 100 MiB), we never benefit from multi-threading:
# level 9 → 64 MiB dictionary → ×3 default block size = 192 MiB.
# With a block size of 32 MiB, compression with 4 threads is ~2.7 times faster,
# for a final output size increase of just 200 KiB (less than 1%).
"${tar_compress_cmd[@]}" |
xz -9 ${jobs:+--threads=${jobs}} "${options[@]}" |
xz -9 --block-size=32M ${jobs:+--threads=${jobs}} "${options[@]}" |
write_to_file "${output}"
;;
tar.zst)