From 7739d1863cb6ea5de819e1ae1c1ee10e8109d32b Mon Sep 17 00:00:00 2001 From: "Alex Xu (Hello71)" Date: Tue, 21 Apr 2020 23:10:07 -0400 Subject: POSIXify, add docs, other changes --- comp_bench | 21 +++++++++++++++++++++ 1 file changed, 21 insertions(+) create mode 100755 comp_bench (limited to 'comp_bench') 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 -- cgit v1.2.3-70-g09d2