summaryrefslogtreecommitdiff
path: root/comp_bench
diff options
context:
space:
mode:
authorAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2020-04-21 23:10:07 -0400
committerAlex Xu (Hello71) <alex_y_xu@yahoo.ca>2020-04-21 23:35:14 -0400
commit7739d1863cb6ea5de819e1ae1c1ee10e8109d32b (patch)
treea9eeabbf583cc19ee1539bed51e08075d226132e /comp_bench
parent542cfed39c3b3b93e5bab3f7c45d741b71e7c3d7 (diff)
downloadminitramfs-7739d1863cb6ea5de819e1ae1c1ee10e8109d32b.tar.xz
minitramfs-7739d1863cb6ea5de819e1ae1c1ee10e8109d32b.zip
POSIXify, add docs, other changes
Diffstat (limited to 'comp_bench')
-rwxr-xr-xcomp_bench21
1 files changed, 21 insertions, 0 deletions
diff --git a/comp_bench b/comp_bench
new file mode 100755
index 0000000..01387da
--- /dev/null
+++ b/comp_bench
@@ -0,0 +1,21 @@
+#!/bin/sh
+
+set -e
+
+do_bench() {
+ tmpfile=$(mktemp)
+ trap 'rm -f "$tmpfile"' EXIT
+ compressor=cat outfile=/proc/self/fd/1 ./make | "$@" -c < initramfs.img > "$tmpfile"
+ printf '%s: %s bytes\n' "$1" "$(wc -c < "$tmpfile")"
+ time $1 -dc < "$tmpfile" >/dev/null
+ rm "$tmpfile"
+ trap '' EXIT
+ echo
+}
+
+do_bench gzip -9
+do_bench bzip2 -9
+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