Created
February 5, 2018 08:30
-
-
Save fcamel/7fe7e3bdfdabcfeb264780f45ecb8628 to your computer and use it in GitHub Desktop.
benchmark gzip / brotli
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#!/bin/bash | |
rm -rf output | |
mkdir output | |
ls -l input | awk '{ s += $5 } END { print s }' | |
# compress | |
begin=$(date +%s%N) | |
for f in input/* | |
do | |
# gzip -k $f -c > output/$(basename $f).gz | |
./brotli -k $f -o output/$(basename $f).bt | |
done | |
end=$(date +%s%N) | |
echo $(( (end - begin) / 1000000)) | |
ls -l output | awk '{ s += $5 } END { print s }' | |
# decompress | |
rm -rf output2 | |
mkdir output2 | |
begin=$(date +%s%N) | |
for f in output/* | |
do | |
# gzip -k -d $f -c > output2/$(basename $f .gz) | |
./brotli -k -d $f -o output2/$(basename $f bt) | |
done | |
end=$(date +%s%N) | |
echo $(( (end - begin) / 1000000)) | |
ls -l output2 | awk '{ s += $5 } END { print s }' |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment