summaryrefslogtreecommitdiff
path: root/comp_bench
diff options
context:
space:
mode:
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