chore: use parallel xz with higher compression level

Preset `-0` for xz means fast compression but low compression level.
Changing this to `-6` (default) means that result is 10% smaller (tested
with RPi4 image).

Enable parallel compression with number of threads equal to number of
CPUs to make it compress even faster then with `-0`:

* `-0`: 15s
* `-6`: 60s
* `-6 -T 0`: 10s (on my machine, depends on number of cores)

Signed-off-by: Andrey Smirnov <smirnov.andrey@gmail.com>
This commit is contained in:
Andrey Smirnov 2021-08-06 18:11:47 +03:00 committed by talos-bot
parent 571f7db1bb
commit 6d6ed1170f

View File

@ -186,7 +186,7 @@ func tar(filename, src, dir string) error {
} }
func xz(filename string) error { func xz(filename string) error {
if _, err := cmd.Run("xz", "-0", filename); err != nil { if _, err := cmd.Run("xz", "-6", "-T", "0", filename); err != nil {
return err return err
} }