From e799ae672d64e6d3f943f79cda67be12a2b999e1 Mon Sep 17 00:00:00 2001 From: Jakob Unterwurzacher Date: Sat, 23 Jan 2016 20:17:34 +0100 Subject: Show new benchmark.bash in README The old benchmark is in benchmark-builtin.bash. renamed: benchmarks-builtin.bash -> benchmark-builtin.bash renamed: benchmarks-external.bash -> benchmark.bash --- README.md | 20 +++++++++----------- benchmark-builtin.bash | 10 ++++++++++ benchmark.bash | 36 ++++++++++++++++++++++++++++++++++++ benchmarks-builtin.bash | 7 ------- benchmarks-external.bash | 34 ---------------------------------- 5 files changed, 55 insertions(+), 52 deletions(-) create mode 100755 benchmark-builtin.bash create mode 100755 benchmark.bash delete mode 100755 benchmarks-builtin.bash delete mode 100755 benchmarks-external.bash diff --git a/README.md b/README.md index f49bfb1..753e390 100644 --- a/README.md +++ b/README.md @@ -82,17 +82,15 @@ Run `./benchmark.bash` to run the benchmarks. The output should look like this: - ./benchmark.bash - gocryptfs v0.3.1-30-gd69e0df-dirty; on-disk format 2 - PASS - BenchmarkStreamWrite-2 100 12246070 ns/op 85.63 MB/s - BenchmarkStreamRead-2 200 9125990 ns/op 114.90 MB/s - BenchmarkCreate0B-2 10000 101284 ns/op - BenchmarkCreate1B-2 10000 178356 ns/op 0.01 MB/s - BenchmarkCreate100B-2 5000 361014 ns/op 0.28 MB/s - BenchmarkCreate4kB-2 5000 375035 ns/op 10.92 MB/s - BenchmarkCreate10kB-2 3000 491071 ns/op 20.85 MB/s - ok github.com/rfjakob/gocryptfs/integration_tests 17.216s +``` +$ ./benchmark.bash +linux-3.0.tar.gz 100%[===========================>] 92,20M 2,96MB/s in 35s +2016-01-23 20:08:11 URL:https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.gz [...] +WRITE: 131072000 bytes (131 MB) copied, 1,36225 s, 96,2 MB/s +UNTAR: 23.16 +LS: 1.71 +RM: 4.36 +``` Changelog --------- diff --git a/benchmark-builtin.bash b/benchmark-builtin.bash new file mode 100755 index 0000000..145fcfd --- /dev/null +++ b/benchmark-builtin.bash @@ -0,0 +1,10 @@ +#!/bin/bash + +# Run the synthetic benchmarks that are built into gocryptfs using +# "go test". + +set -eu + +source build.bash + +go test ./integration_tests -bench=. -defaultonly diff --git a/benchmark.bash b/benchmark.bash new file mode 100755 index 0000000..55f6fa2 --- /dev/null +++ b/benchmark.bash @@ -0,0 +1,36 @@ +#!/bin/bash + +# Run the set of "canonical" benchmarks that are shown on +# https://nuetzlich.net/gocryptfs/comparison/ + +set -eu + +TIME="/usr/bin/time -f %e" + +# Setup +cd /tmp +wget -nv --show-progress -c https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.gz +DIR1=$(mktemp -d) +DIR2=$(mktemp -d) +gocryptfs -q -init -extpass="echo test" $DIR1 +gocryptfs -q -extpass="echo test" $DIR1 $DIR2 +cd $DIR2 + +# Benchmarks +echo -n "WRITE: " +dd if=/dev/zero of=zero bs=128K count=1000 2>&1 | tail -n 1 +rm zero +sleep 1 +echo -n "UNTAR: " +$TIME tar xzf ../linux-3.0.tar.gz +sleep 1 +echo -n "LS: " +$TIME ls -lR linux-3.0 > /dev/null +sleep 1 +echo -n "RM: " +$TIME rm -Rf linux-3.0 + +# Cleanup +cd .. +fusermount -u $DIR2 -z +rm -Rf $DIR1 $DIR2 diff --git a/benchmarks-builtin.bash b/benchmarks-builtin.bash deleted file mode 100755 index 41f0aa7..0000000 --- a/benchmarks-builtin.bash +++ /dev/null @@ -1,7 +0,0 @@ -#!/bin/bash - -set -eu - -source build.bash - -go test ./integration_tests -bench=. -defaultonly diff --git a/benchmarks-external.bash b/benchmarks-external.bash deleted file mode 100755 index f48c7ac..0000000 --- a/benchmarks-external.bash +++ /dev/null @@ -1,34 +0,0 @@ -#!/bin/bash - -set -eu - -TIME="/usr/bin/time -f %e" - -# Setup -cd /tmp -wget -q -c https://www.kernel.org/pub/linux/kernel/v3.0/linux-3.0.tar.gz -DIR1=$(mktemp -d) -DIR2=$(mktemp -d) -gocryptfs -q -init -extpass="echo test" $DIR1 -gocryptfs -q -extpass="echo test" $DIR1 $DIR2 -cd $DIR2 -echo - -# Benchmarks -echo -n "WRITE: " -dd if=/dev/zero of=zero bs=128K count=1000 2>&1 | tail -n 1 -rm zero -sleep 1 -echo -n "UNTAR: " -$TIME tar xzf ../linux-3.0.tar.gz -sleep 1 -echo -n "LS: " -$TIME ls -lR linux-3.0 > /dev/null -sleep 1 -echo -n "RM: " -$TIME rm -Rf linux-3.0 - -# Cleanup -cd .. -fusermount -u $DIR2 -z -rm -Rf $DIR1 $DIR2 -- cgit v1.2.3