summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xcomp_bench6
1 files 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 <initramfs.img >"$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