2021-01-21 12:27:11 +01:00
|
|
|
#!/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"
|
|
|
|
|
2021-01-26 15:49:25 +01:00
|
|
|
cd "$workdir"
|
|
|
|
|
|
|
|
cd ..
|
|
|
|
|
2021-01-21 12:27:11 +01:00
|
|
|
if [[ -f compression-results.txt ]]; then
|
|
|
|
rm compression-results.txt
|
|
|
|
fi
|
|
|
|
|
2021-01-26 19:10:21 +01:00
|
|
|
# run compression with 4 threads
|
2021-01-26 15:49:25 +01:00
|
|
|
for i in {1..19}; do
|
2021-01-26 20:35:45 +01:00
|
|
|
for x in {1..5}; do
|
2021-01-26 19:10:21 +01:00
|
|
|
# remove previous round
|
|
|
|
if [[ -f zstd-$i.tar.zst ]]; then
|
|
|
|
rm zstd-$i.tar.zst
|
|
|
|
fi
|
|
|
|
echo "zstd -$i -T4: Run $x" >> compression-results.txt
|
|
|
|
{ time tar -c -I"zstd -$i -T4" -f zstd-$i.tar.zst "$workdir" 2> /dev/null ; } 2>> compression-results.txt
|
2021-01-26 15:49:25 +01:00
|
|
|
echo "-----------------------------" >> compression-results.txt
|
2021-01-26 19:10:21 +01:00
|
|
|
echo "Finished Run $x with zstd -$i -T4"
|
2021-01-26 15:49:25 +01:00
|
|
|
done
|
|
|
|
done
|