Skip to content

Commit

Permalink
archive: use zstd if available
Browse files Browse the repository at this point in the history
the performance improvement is not as clear as with pigz, but it is
still measurable difference.

Signed-off-by: Giuseppe Scrivano <[email protected]>
  • Loading branch information
giuseppe committed Jun 11, 2024
1 parent fd62e40 commit 2fc8de5
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions pkg/archive/archive.go
Original file line number Diff line number Diff line change
Expand Up @@ -210,6 +210,9 @@ func DecompressStream(archive io.Reader) (io.ReadCloser, error) {
readBufWrapper := p.NewReadCloserWrapper(buf, xzReader)
return readBufWrapper, nil
case Zstd:
if rc, canUse := tryProcFilter([]string{"zstd", "-d"}, buf); canUse {
return p.NewReadCloserWrapper(buf, rc), nil
}
return zstdReader(buf)
default:
return nil, fmt.Errorf("unsupported compression format %s", (&compression).Extension())
Expand Down

0 comments on commit 2fc8de5

Please sign in to comment.