summaryrefslogtreecommitdiff
path: root/tests/benc.sh
blob: 5ca7ae3bd5c230bec834478557ac47917bbd8cc8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
#!/bin/sh
set -e
AEC=../src/aec
test_data=https://gitlab.dkrz.de/k202009/libaec/raw/master/data/typical.rz
if [ ! -f  typical.dat ]; then
    rm -f typical.rz
    type wget >/dev/null 2>&1 || {
        echo >&2 "wget not found. Please download $test_data by other means and place it in tests. Aborting."
        exit 1
    }
    wget $test_data || {
        echo >&2 "Could not download $test_data. Please download it by other means and place it in tests. Aborting."
        exit 1
    }
    $AEC -d -n16 -j64 -r256 -m typical.rz typical.dat
    rm -f bench.dat
fi
if [ ! -f  bench.dat ]; then
    for i in $(seq 0 499);
    do
        cat typical.dat >> bench.dat
    done
fi
rm -f bench.rz
utime=$(../src/utime $AEC -n16 -j64 -r256 -m bench.dat bench.rz 2>&1)
bsize=$(wc -c bench.dat | awk '{print $1}')
perf=$(echo "$bsize/1048576/$utime" | bc)
echo "*** Encoding with $perf MiB/s user time ***"