aboutsummaryrefslogtreecommitdiff
path: root/tests/canonical-benchmarks.bash
diff options
context:
space:
mode:
authorJakob Unterwurzacher2023-05-12 09:55:54 +0200
committerJakob Unterwurzacher2023-05-12 09:55:54 +0200
commit1a866b73731ce58b0ba31d80a2a84c84737c7d30 (patch)
tree9b76a01cee442280393fa596dde9814fe8d4c7d5 /tests/canonical-benchmarks.bash
parentaa1d8a0f90a1046b89dfdd9e58fb1407c76ff27e (diff)
canonical-benchmarks.bash: drop page cache of "zero" file
For the streaming read benchmark, we don't want to benchmark the page cache.
Diffstat (limited to 'tests/canonical-benchmarks.bash')
-rwxr-xr-xtests/canonical-benchmarks.bash8
1 files changed, 7 insertions, 1 deletions
diff --git a/tests/canonical-benchmarks.bash b/tests/canonical-benchmarks.bash
index 195effe..4c1a357 100755
--- a/tests/canonical-benchmarks.bash
+++ b/tests/canonical-benchmarks.bash
@@ -35,7 +35,13 @@ function etime {
}
echo -n "WRITE: "
-dd if=/dev/zero of=zero bs=131072 count=2000 2>&1 | tail -n 1
+dd if=/dev/zero of=zero bs=131072 count=2000 conv=fsync 2>&1 | tail -n 1
+
+# Drop cache of file "zero", otherwise we are benchmarking the
+# page cache. Borrowed from
+# https://www.gnu.org/software/coreutils/manual/html_node/dd-invocation.html#index-nocache
+dd if=zero iflag=nocache count=0 status=none
+
sleep 0.1
echo -n "READ: "
dd if=zero of=/dev/null bs=131072 count=2000 2>&1 | tail -n 1