2016-07-16 18:08:01 +02:00
|
|
|
#!/bin/bash -eu
|
|
|
|
#
|
|
|
|
# Run the set of "canonical" benchmarks that are shown on
|
|
|
|
# https://nuetzlich.net/gocryptfs/comparison/
|
|
|
|
# against the directory passed as "$1".
|
|
|
|
#
|
|
|
|
# This is called by the top-level script "benchmark.bash".
|
|
|
|
|
2017-01-03 14:17:19 +01:00
|
|
|
cd "$(dirname "$0")"
|
|
|
|
MYNAME=$(basename "$0")
|
2017-03-18 16:23:33 +01:00
|
|
|
MD5="$PWD/stress_tests/linux-3.0.md5sums"
|
2017-01-03 14:17:19 +01:00
|
|
|
|
2016-07-16 18:08:01 +02:00
|
|
|
if [ $# -ne 1 ]; then
|
|
|
|
echo "usage: $MYNAME TESTDIR"
|
|
|
|
exit 1
|
|
|
|
fi
|
|
|
|
|
2017-01-03 14:17:19 +01:00
|
|
|
# Download /tmp/linux-3.0.tar.gz
|
|
|
|
./dl-linux-tarball.bash
|
|
|
|
|
2016-12-13 22:13:12 +01:00
|
|
|
# cd to TESTDIR
|
2016-07-16 18:08:01 +02:00
|
|
|
cd "$1"
|
|
|
|
|
2017-02-16 19:01:24 +01:00
|
|
|
# Execute command, discard all stdout output, print elapsed time
|
|
|
|
# (to stderr, unfortunately).
|
2016-07-16 18:08:01 +02:00
|
|
|
function etime {
|
2017-06-01 18:53:57 +02:00
|
|
|
# Make the bash builtin "time" print out only the elapsed wall clock
|
2017-02-16 19:01:24 +01:00
|
|
|
# seconds
|
|
|
|
TIMEFORMAT=%R
|
|
|
|
time "$@" > /dev/null
|
2016-07-16 18:08:01 +02:00
|
|
|
}
|
|
|
|
|
|
|
|
echo -n "WRITE: "
|
2016-12-13 22:13:12 +01:00
|
|
|
dd if=/dev/zero of=zero bs=131072 count=2000 2>&1 | tail -n 1
|
2017-06-27 00:04:58 +02:00
|
|
|
sleep 0.1
|
|
|
|
echo -n "READ: "
|
|
|
|
dd if=zero of=/dev/null bs=131072 count=2000 2>&1 | tail -n 1
|
2016-07-16 18:08:01 +02:00
|
|
|
rm zero
|
2017-06-27 00:04:58 +02:00
|
|
|
sleep 0.1
|
2016-07-16 18:08:01 +02:00
|
|
|
echo -n "UNTAR: "
|
2017-01-03 14:17:19 +01:00
|
|
|
etime tar xzf /tmp/linux-3.0.tar.gz
|
2017-06-27 00:04:58 +02:00
|
|
|
sleep 0.1
|
2017-03-18 16:23:33 +01:00
|
|
|
echo -n "MD5: "
|
|
|
|
etime md5sum --quiet -c $MD5
|
2017-06-27 00:04:58 +02:00
|
|
|
sleep 0.1
|
2016-07-16 18:08:01 +02:00
|
|
|
echo -n "LS: "
|
|
|
|
etime ls -lR linux-3.0
|
2017-06-27 00:04:58 +02:00
|
|
|
sleep 0.1
|
2016-07-16 18:08:01 +02:00
|
|
|
echo -n "RM: "
|
|
|
|
etime rm -Rf linux-3.0
|