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