From a0af3885c658e12addb7d6a260d8ef17e163a29c Mon Sep 17 00:00:00 2001 From: RealStickman Date: Thu, 21 Jan 2021 12:27:11 +0100 Subject: [PATCH] Script for benchmarking compression --- .../scripts/pieces/measure-compression.sh | 31 +++++++++++++++++++ 1 file changed, 31 insertions(+) create mode 100644 arch-config/scripts/pieces/measure-compression.sh diff --git a/arch-config/scripts/pieces/measure-compression.sh b/arch-config/scripts/pieces/measure-compression.sh new file mode 100644 index 00000000..a8726e97 --- /dev/null +++ b/arch-config/scripts/pieces/measure-compression.sh @@ -0,0 +1,31 @@ +#!/usr/bin/env bash +set -euo pipefail + +# { time tar -c -I"zstd -19 -T0" -f polybar-themes2.tar.zst polybar-themes/ ; } 2> result + +# read working directory +workdir="$1" + +if [[ -f compression-results.txt ]]; then + rm compression-results.txt +fi + +echo "zstd -1 -T0" >> compression-results.txt +{ time tar -c -I"zstd -1 -T0" -f zstd-1.tar.zst "$workdir" 2> /dev/null ; } 2>> compression-results.txt +echo "-----------------------------" >> compression-results.txt + +echo "zstd -2 -T0" >> compression-results.txt +{ time tar -c -I"zstd -2 -T0" -f zstd-2.tar.zst "$workdir" 2> /dev/null ; } 2>> compression-results.txt +echo "-----------------------------" >> compression-results.txt + +echo "zstd -3 -T0" >> compression-results.txt +{ time tar -c -I"zstd -3 -T0" -f zstd-3.tar.zst "$workdir" 2> /dev/null ; } 2>> compression-results.txt +echo "-----------------------------" >> compression-results.txt + +echo "zstd -4 -T0" >> compression-results.txt +{ time tar -c -I"zstd -4 -T0" -f zstd-4.tar.zst "$workdir" 2> /dev/null ; } 2>> compression-results.txt +echo "-----------------------------" >> compression-results.txt + +echo "zstd -5 -T0" >> compression-results.txt +{ time tar -c -I"zstd -5 -T0" -f zstd-5.tar.zst "$workdir" 2> /dev/null ; } 2>> compression-results.txt +echo "-----------------------------" >> compression-results.txt