Skip to content

Commit

Permalink
chore: use parallel xz with higher compression level
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
smira authored and talos-bot committed Aug 6, 2021
1 parent 571f7db commit 6d6ed11
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion cmd/installer/cmd/image.go
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ func tar(filename, src, dir 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
}

Expand Down

0 comments on commit 6d6ed11

Please sign in to comment.