summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2020-11-25 17:08:08 -0500
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2020-11-25 17:08:08 -0500
commitba9b4aab3daa4acbf6a8b0cc44f882e404e9f0e4 (patch)
tree974699a8ef908df852ef9f3c355740d85d583129
parentfb5c3d35f98f89adf55358a94fc3af761020b913 (diff)
downloadminitramfs-ba9b4aab3daa4acbf6a8b0cc44f882e404e9f0e4.tar.xz
minitramfs-ba9b4aab3daa4acbf6a8b0cc44f882e404e9f0e4.zip
comp_bench: update, add zstd
-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