From ba9b4aab3daa4acbf6a8b0cc44f882e404e9f0e4 Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Wed, 25 Nov 2020 17:08:08 -0500 Subject: comp_bench: update, add zstd --- comp_bench | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/comp_bench b/comp_bench index d7f929d..22bb906 100755 --- a/comp_bench +++ b/comp_bench @@ -10,8 +10,9 @@ do_time() { } do_bench() { + tmpfile= + trap '[ -n "$tmpfile" ] && rm -f "$tmpfile"' HUP INT QUIT TERM EXIT tmpfile=$(mktemp) - trap 'rm -f "$tmpfile"' HUP INT QUIT TERM EXIT [ -z "$verbose" ] || printf '%s compression:\n' "$1" ${verbose+do_time} "$@" -c "$tmpfile" printf '%s size: %s bytes\n' "$1" "$(wc -c < "$tmpfile")" @@ -24,7 +25,7 @@ do_bench() { if [ -e initramfs.img ] && [ "$(file -b initramfs.img)" != "ASCII cpio archive (SVR4 with no CRC)" ]; then echo "warning: overwriting initramfs.img" >&2 - compressor=cat ./make > initramfs.img + COMPRESSOR=cat ./make fi do_bench gzip -9 do_bench bzip2 -9 @@ -32,3 +33,4 @@ do_bench lzma -9e --check=crc32 do_bench xz --check=crc32 --x86 --lzma2=preset=9e do_bench lzop -9 do_bench lz4 --best --favor-decSpeed -l +do_bench zstd -19 -- cgit v1.2.3-70-g09d2