Compress images using xz instead of gzip (#1018)

The xz compression allows higher compression rates and higher speeds,
a quick measurement lead to this numbers:
gzip --best: compression 131.11s, decompression 9.797s (299M)
xz -3 (single thread): compression 95.13s, decompression 14.902s (228M)
xz -3 (multi thread): compression 12.146s, decompression 14.902s (228M)
This commit is contained in:
Stefan Agner 2020-11-26 00:29:11 +01:00 committed by GitHub
parent 4be3dee0b4
commit 1a6dcbbf5b
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
9 changed files with 14 additions and 14 deletions

View File

@ -21,5 +21,5 @@ function hassos_pre_image() {
function hassos_post_image() { function hassos_post_image() {
convert_disk_image_gz convert_disk_image_xz
} }

View File

@ -22,6 +22,6 @@ function hassos_pre_image() {
function hassos_post_image() { function hassos_post_image() {
convert_disk_image_gz convert_disk_image_xz
} }

View File

@ -19,5 +19,5 @@ function hassos_pre_image() {
function hassos_post_image() { function hassos_post_image() {
convert_disk_image_gz convert_disk_image_xz
} }

View File

@ -19,6 +19,6 @@ function hassos_pre_image() {
function hassos_post_image() { function hassos_post_image() {
convert_disk_image_gz convert_disk_image_xz
} }

View File

@ -26,5 +26,5 @@ function hassos_pre_image() {
function hassos_post_image() { function hassos_post_image() {
convert_disk_image_gz convert_disk_image_xz
} }

View File

@ -15,6 +15,6 @@ function hassos_pre_image() {
function hassos_post_image() { function hassos_post_image() {
convert_disk_image_gz convert_disk_image_xz
} }

View File

@ -22,10 +22,10 @@ function hassos_post_image() {
# Virtual Disk images # Virtual Disk images
convert_disk_image_virtual convert_disk_image_virtual
convert_disk_image_gz vmdk convert_disk_image_xz vmdk
convert_disk_image_gz vhdx convert_disk_image_xz vhdx
convert_disk_image_gz vdi convert_disk_image_xz vdi
convert_disk_image_gz qcow2 convert_disk_image_xz qcow2
# OVA # OVA
mkdir -p "${OVA_DATA}" mkdir -p "${OVA_DATA}"

View File

@ -33,6 +33,6 @@ function hassos_pre_image() {
function hassos_post_image() { function hassos_post_image() {
convert_disk_image_gz convert_disk_image_xz
} }

View File

@ -312,10 +312,10 @@ function convert_disk_image_virtual() {
} }
function convert_disk_image_gz() { function convert_disk_image_xz() {
local hdd_ext=${1:-img} local hdd_ext=${1:-img}
local hdd_img="$(hassos_image_name "${hdd_ext}")" local hdd_img="$(hassos_image_name "${hdd_ext}")"
rm -f "${hdd_img}.gz" rm -f "${hdd_img}.xz"
gzip --best "${hdd_img}" xz -3 -T0 "${hdd_img}"
} }