From f4cc7726e997181c742825a6e6adb68298a47ce9 Mon Sep 17 00:00:00 2001 From: Evgenii Stratonikov Date: Wed, 9 Mar 2022 17:19:40 +0300 Subject: [PATCH] benchmark: fix shellcheck issues Signed-off-by: Evgenii Stratonikov --- benchmark | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/benchmark b/benchmark index 6d16439..6c9347d 100755 --- a/benchmark +++ b/benchmark @@ -1,12 +1,14 @@ #!/bin/bash -tmpfile=$(mktemp /tmp/random-file.XXXXXX) -dd if=/dev/urandom of=$tmpfile bs=$1 count=1 +BLOCK_SIZE=${1:-1G} # gigabyte by default +OUT="${OUT:-$(mktemp /tmp/random-file.XXXXXX)}" + +dd if=/dev/urandom of="$OUT" bs="$BLOCK_SIZE" count=1 go build ./cmd/tzsum || exit 1 for impl in avx avx2 generic; do echo $impl implementation: - time ./tzsum -name $tmpfile -impl $impl + time ./tzsum -name "$OUT" -impl $impl echo done