mirror of
https://github.com/cuberite/libdeflate.git
synced 2025-09-09 20:29:26 -04:00
Add produce_gzip_benchmark_table.sh
This commit is contained in:
parent
92e6c1ff01
commit
6acb3054f8
35
tools/produce_gzip_benchmark_table.sh
Executable file
35
tools/produce_gzip_benchmark_table.sh
Executable file
@ -0,0 +1,35 @@
|
||||
#!/bin/bash
|
||||
|
||||
do_benchmark() {
|
||||
usize=$(stat -c %s "$file")
|
||||
"$HOME/proj/libdeflate/benchmark" -g -s $usize "$@" "$file" \
|
||||
| grep Compressed | cut -f 4 -d ' '
|
||||
}
|
||||
|
||||
echo "File | zlib -6 | zlib -9 | libdeflate -6 | libdeflate -9 | libdeflate -12"
|
||||
echo "-----|---------|---------|---------------|---------------|---------------"
|
||||
|
||||
for file in "$@"; do
|
||||
echo -n "$(basename "$file")"
|
||||
results=()
|
||||
results+=($(do_benchmark -Y -l 6))
|
||||
results+=($(do_benchmark -Y -l 9))
|
||||
results+=($(do_benchmark -l 6))
|
||||
results+=($(do_benchmark -l 9))
|
||||
results+=($(do_benchmark -l 12))
|
||||
best=2000000000
|
||||
for result in "${results[@]}"; do
|
||||
if (( result < best)); then
|
||||
best=$result
|
||||
fi
|
||||
done
|
||||
for result in "${results[@]}"; do
|
||||
if (( result == best )); then
|
||||
em="**"
|
||||
else
|
||||
em=""
|
||||
fi
|
||||
echo -n " | ${em}${result}${em}"
|
||||
done
|
||||
echo
|
||||
done
|
Loading…
x
Reference in New Issue
Block a user