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")
|
|
|
|
|
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-02-16 19:01:24 +01:00
|
|
|
# Make the bash builtin "time" print out only the elapse wall clock
|
|
|
|
# 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
|
2016-07-16 18:08:01 +02:00
|
|
|
rm zero
|
|
|
|
sleep 1
|
|
|
|
echo -n "UNTAR: "
|
2017-01-03 14:17:19 +01:00
|
|
|
etime tar xzf /tmp/linux-3.0.tar.gz
|
2016-07-16 18:08:01 +02:00
|
|
|
sleep 1
|
|
|
|
echo -n "LS: "
|
|
|
|
etime ls -lR linux-3.0
|
|
|
|
sleep 1
|
|
|
|
echo -n "RM: "
|
|
|
|
etime rm -Rf linux-3.0
|