mirror of
https://github.com/cuberite/libdeflate.git
synced 2025-09-10 12:58:30 -04:00
scripts/produce_gzip_benchmark_table.sh: clean up
Address all shellcheck warnings, avoid hardcoded path, and add '-u -o pipefail'.
This commit is contained in:
parent
61583588cd
commit
68a5b89a1b
@ -1,10 +1,10 @@
|
|||||||
#!/bin/bash
|
#!/bin/bash
|
||||||
|
|
||||||
set -e
|
set -eu -o pipefail
|
||||||
|
topdir="$(dirname "$0")/.."
|
||||||
|
|
||||||
do_benchmark() {
|
do_benchmark() {
|
||||||
usize=$(stat -c %s "$file")
|
"$topdir/benchmark" -g -s "$(stat -c %s "$file")" "$@" "$file" \
|
||||||
"$HOME/proj/libdeflate/benchmark" -g -s $usize "$@" "$file" \
|
|
||||||
| grep Compressed | cut -f 4 -d ' '
|
| grep Compressed | cut -f 4 -d ' '
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -14,11 +14,11 @@ echo "-----|---------|---------|---------------|---------------|---------------"
|
|||||||
for file in "$@"; do
|
for file in "$@"; do
|
||||||
echo -n "$(basename "$file")"
|
echo -n "$(basename "$file")"
|
||||||
results=()
|
results=()
|
||||||
results+=($(do_benchmark -Y -6))
|
results+=("$(do_benchmark -Y -6)")
|
||||||
results+=($(do_benchmark -Y -9))
|
results+=("$(do_benchmark -Y -9)")
|
||||||
results+=($(do_benchmark -6))
|
results+=("$(do_benchmark -6)")
|
||||||
results+=($(do_benchmark -9))
|
results+=("$(do_benchmark -9)")
|
||||||
results+=($(do_benchmark -12))
|
results+=("$(do_benchmark -12)")
|
||||||
best=2000000000
|
best=2000000000
|
||||||
for result in "${results[@]}"; do
|
for result in "${results[@]}"; do
|
||||||
if (( result < best)); then
|
if (( result < best)); then
|
||||||
|
Loading…
x
Reference in New Issue
Block a user