refactor: move hyperfine call into fn, cleanup code
Also tried +short and -Q options for dig and drill, but it only increased time. Anyway, now it's more convenient to append options.
This commit is contained in:
parent
33e135a13d
commit
667e6433a6
1 changed files with 13 additions and 21 deletions
34
main.sh
34
main.sh
|
@ -57,43 +57,35 @@ echo
|
||||||
echo '==> Starting Unbound'
|
echo '==> Starting Unbound'
|
||||||
unbound -c ./unbound.conf -dp 2>unbound.log &
|
unbound -c ./unbound.conf -dp 2>unbound.log &
|
||||||
unbound_pid=$!
|
unbound_pid=$!
|
||||||
sleep 4
|
sleep 2
|
||||||
|
|
||||||
|
|
||||||
|
run_bench () {
|
||||||
|
hyperfine -N -w 30 \
|
||||||
|
"$exe_dig -p 2253 $1 $2 @127.0.0.1" \
|
||||||
|
"$exe_drill -p 2253 $1 $2 @127.0.0.1" \
|
||||||
|
"$exe_hr -n 127.0.0.1:2253 -t $1 $2"
|
||||||
|
}
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo '==> Benchmarks for A domain.tld.'
|
echo '==> Benchmarks for A domain.tld.'
|
||||||
hyperfine -N -w 30 \
|
run_bench A domain.tld
|
||||||
"$exe_dig -p 2253 domain.tld @127.0.0.1" \
|
|
||||||
"$exe_drill -p 2253 domain.tld @127.0.0.1" \
|
|
||||||
"$exe_hr -n 127.0.0.1:2253 domain.tld"
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo '==> Benchmarks for AAAA domain.tld.'
|
echo '==> Benchmarks for AAAA domain.tld.'
|
||||||
hyperfine -N -w 30 \
|
run_bench AAAA domain.tld
|
||||||
"$exe_dig -p 2253 aaaa domain.tld @127.0.0.1" \
|
|
||||||
"$exe_drill -p 2253 aaaa domain.tld @127.0.0.1" \
|
|
||||||
"$exe_hr -n 127.0.0.1:2253 -t AAAA domain.tld"
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo '==> Benchmarks for MX domain.tld.'
|
echo '==> Benchmarks for MX domain.tld.'
|
||||||
hyperfine -N -w 30 \
|
run_bench MX domain.tld
|
||||||
"$exe_dig -p 2253 mx domain.tld @127.0.0.1" \
|
|
||||||
"$exe_drill -p 2253 mx domain.tld @127.0.0.1" \
|
|
||||||
"$exe_hr -n 127.0.0.1:2253 -t MX domain.tld"
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo '==> Benchmarks for CNAME mail.domain.tld.'
|
echo '==> Benchmarks for CNAME mail.domain.tld.'
|
||||||
hyperfine -N -w 30 \
|
run_bench A mail.domain.tld
|
||||||
"$exe_dig -p 2253 mail.domain.tld @127.0.0.1" \
|
|
||||||
"$exe_drill -p 2253 mail.domain.tld @127.0.0.1" \
|
|
||||||
"$exe_hr -n 127.0.0.1:2253 mail.domain.tld"
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
echo '==> Benchmarks for TXT txt.domain.tld.'
|
echo '==> Benchmarks for TXT txt.domain.tld.'
|
||||||
hyperfine -N -w 30 \
|
run_bench TXT txt.domain.tld
|
||||||
"$exe_dig -p 2253 txt txt.domain.tld @127.0.0.1" \
|
|
||||||
"$exe_drill -p 2253 txt txt.domain.tld @127.0.0.1" \
|
|
||||||
"$exe_hr -n 127.0.0.1:2253 -t TXT txt.domain.tld"
|
|
||||||
|
|
||||||
|
|
||||||
echo
|
echo
|
||||||
|
|
Loading…
Add table
Reference in a new issue