From 33e135a13dd7ca1c4e8015bdffd727414407226b Mon Sep 17 00:00:00 2001 From: DarkCat09 Date: Sat, 21 Dec 2024 11:22:15 +0400 Subject: [PATCH] feat: add benchmark for TXT --- main.sh | 7 ++++ results1.txt | 102 ------------------------------------------------- results2.txt | 105 --------------------------------------------------- unbound.conf | 5 +++ 4 files changed, 12 insertions(+), 207 deletions(-) delete mode 100644 results1.txt delete mode 100644 results2.txt diff --git a/main.sh b/main.sh index 691eb09..ff0aaba 100755 --- a/main.sh +++ b/main.sh @@ -88,6 +88,13 @@ hyperfine -N -w 30 \ "$exe_drill -p 2253 mail.domain.tld @127.0.0.1" \ "$exe_hr -n 127.0.0.1:2253 mail.domain.tld" +echo +echo '==> Benchmarks for TXT txt.domain.tld.' +hyperfine -N -w 30 \ + "$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 '==> All done' diff --git a/results1.txt b/results1.txt deleted file mode 100644 index dcd939d..0000000 --- a/results1.txt +++ /dev/null @@ -1,102 +0,0 @@ -==> Checking deps -/usr/sbin/unbound -/usr/sbin/hyperfine -dig: using custom build at bind9/bin/dig/dig -drill: using custom build at ldns/drill/drill -resolve: using custom build at hickory-dns/target/release/resolve - -==> Starting Unbound - -==> Benchmarks for A domain.tld. -Benchmark 1: bind9/bin/dig/dig -p 2253 domain.tld @127.0.0.1 - Time (mean ± σ): 9.3 ms ± 0.6 ms [User: 7.0 ms, System: 2.7 ms] - Range (min … max): 8.7 ms … 13.0 ms 285 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Benchmark 2: ldns/drill/drill -p 2253 domain.tld @127.0.0.1 - Time (mean ± σ): 4.2 ms ± 0.1 ms [User: 3.4 ms, System: 1.3 ms] - Range (min … max): 4.1 ms … 5.3 ms 666 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Benchmark 3: hickory-dns/target/release/resolve -n 127.0.0.1:2253 domain.tld - Time (mean ± σ): 2.0 ms ± 2.5 ms [User: 1.3 ms, System: 1.3 ms] - Range (min … max): 1.8 ms … 101.6 ms 1610 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Summary - hickory-dns/target/release/resolve -n 127.0.0.1:2253 domain.tld ran - 2.14 ± 2.71 times faster than ldns/drill/drill -p 2253 domain.tld @127.0.0.1 - 4.66 ± 5.91 times faster than bind9/bin/dig/dig -p 2253 domain.tld @127.0.0.1 - -==> Benchmarks for AAAA domain.tld. -Benchmark 1: bind9/bin/dig/dig -p 2253 aaaa domain.tld @127.0.0.1 - Time (mean ± σ): 9.6 ms ± 1.0 ms [User: 7.1 ms, System: 2.8 ms] - Range (min … max): 8.6 ms … 14.7 ms 326 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Benchmark 2: ldns/drill/drill -p 2253 aaaa domain.tld @127.0.0.1 - Time (mean ± σ): 4.3 ms ± 0.1 ms [User: 3.4 ms, System: 1.3 ms] - Range (min … max): 4.1 ms … 5.0 ms 715 runs - -Benchmark 3: hickory-dns/target/release/resolve -n 127.0.0.1:2253 -t AAAA domain.tld - Time (mean ± σ): 1.9 ms ± 0.9 ms [User: 1.3 ms, System: 1.3 ms] - Range (min … max): 1.8 ms … 34.0 ms 1595 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Summary - hickory-dns/target/release/resolve -n 127.0.0.1:2253 -t AAAA domain.tld ran - 2.19 ± 1.00 times faster than ldns/drill/drill -p 2253 aaaa domain.tld @127.0.0.1 - 4.92 ± 2.30 times faster than bind9/bin/dig/dig -p 2253 aaaa domain.tld @127.0.0.1 - -==> Benchmarks for MX domain.tld. -Benchmark 1: bind9/bin/dig/dig -p 2253 mx domain.tld @127.0.0.1 - Time (mean ± σ): 9.8 ms ± 1.7 ms [User: 7.2 ms, System: 3.1 ms] - Range (min … max): 8.6 ms … 16.7 ms 325 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Benchmark 2: ldns/drill/drill -p 2253 mx domain.tld @127.0.0.1 - Time (mean ± σ): 4.3 ms ± 0.1 ms [User: 3.4 ms, System: 1.3 ms] - Range (min … max): 4.1 ms … 4.9 ms 707 runs - -Benchmark 3: hickory-dns/target/release/resolve -n 127.0.0.1:2253 -t MX domain.tld - Time (mean ± σ): 1.9 ms ± 0.3 ms [User: 1.2 ms, System: 1.3 ms] - Range (min … max): 1.8 ms … 15.2 ms 1617 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Summary - hickory-dns/target/release/resolve -n 127.0.0.1:2253 -t MX domain.tld ran - 2.21 ± 0.39 times faster than ldns/drill/drill -p 2253 mx domain.tld @127.0.0.1 - 5.11 ± 1.27 times faster than bind9/bin/dig/dig -p 2253 mx domain.tld @127.0.0.1 - -==> Benchmarks for CNAME mail.domain.tld. -Benchmark 1: bind9/bin/dig/dig -p 2253 mail.domain.tld @127.0.0.1 - Time (mean ± σ): 9.3 ms ± 0.7 ms [User: 6.9 ms, System: 2.9 ms] - Range (min … max): 8.7 ms … 13.2 ms 325 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Benchmark 2: ldns/drill/drill -p 2253 mail.domain.tld @127.0.0.1 - Time (mean ± σ): 4.2 ms ± 0.1 ms [User: 3.5 ms, System: 1.2 ms] - Range (min … max): 4.1 ms … 4.7 ms 707 runs - -Benchmark 3: hickory-dns/target/release/resolve -n 127.0.0.1:2253 mail.domain.tld - Time (mean ± σ): 2.1 ms ± 3.8 ms [User: 1.4 ms, System: 1.3 ms] - Range (min … max): 1.9 ms … 129.2 ms 1575 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Summary - hickory-dns/target/release/resolve -n 127.0.0.1:2253 mail.domain.tld ran - 1.99 ± 3.60 times faster than ldns/drill/drill -p 2253 mail.domain.tld @127.0.0.1 - 4.38 ± 7.91 times faster than bind9/bin/dig/dig -p 2253 mail.domain.tld @127.0.0.1 - -==> All done - -==> Stopping Unbound diff --git a/results2.txt b/results2.txt deleted file mode 100644 index 419e095..0000000 --- a/results2.txt +++ /dev/null @@ -1,105 +0,0 @@ -==> Checking deps -/usr/sbin/unbound -/usr/sbin/hyperfine -dig: using custom build at bind9/bin/dig/dig -resolve: using custom build at hickory-dns/target/release/resolve - -==> Starting Unbound - -==> Benchmarks for A domain.tld. -Benchmark 1: bind9/bin/dig/dig -p 2253 domain.tld @127.0.0.1 - Time (mean ± σ): 9.5 ms ± 0.8 ms [User: 7.2 ms, System: 2.7 ms] - Range (min … max): 8.7 ms … 13.0 ms 324 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Benchmark 2: /usr/sbin/drill -p 2253 domain.tld @127.0.0.1 - Time (mean ± σ): 2.3 ms ± 0.1 ms [User: 1.6 ms, System: 0.6 ms] - Range (min … max): 2.2 ms … 3.1 ms 1300 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Benchmark 3: hickory-dns/target/release/resolve -n 127.0.0.1:2253 domain.tld - Time (mean ± σ): 1.9 ms ± 0.2 ms [User: 1.2 ms, System: 1.3 ms] - Range (min … max): 1.8 ms … 10.6 ms 1583 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Summary - hickory-dns/target/release/resolve -n 127.0.0.1:2253 domain.tld ran - 1.21 ± 0.15 times faster than /usr/sbin/drill -p 2253 domain.tld @127.0.0.1 - 4.94 ± 0.73 times faster than bind9/bin/dig/dig -p 2253 domain.tld @127.0.0.1 - -==> Benchmarks for AAAA domain.tld. -Benchmark 1: bind9/bin/dig/dig -p 2253 aaaa domain.tld @127.0.0.1 - Time (mean ± σ): 9.5 ms ± 1.0 ms [User: 7.1 ms, System: 2.9 ms] - Range (min … max): 8.7 ms … 14.2 ms 269 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Benchmark 2: /usr/sbin/drill -p 2253 aaaa domain.tld @127.0.0.1 - Time (mean ± σ): 2.4 ms ± 0.1 ms [User: 1.7 ms, System: 0.6 ms] - Range (min … max): 2.2 ms … 3.1 ms 1304 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Benchmark 3: hickory-dns/target/release/resolve -n 127.0.0.1:2253 -t AAAA domain.tld - Time (mean ± σ): 2.0 ms ± 2.9 ms [User: 1.3 ms, System: 1.3 ms] - Range (min … max): 1.8 ms … 116.0 ms 1599 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Summary - hickory-dns/target/release/resolve -n 127.0.0.1:2253 -t AAAA domain.tld ran - 1.18 ± 1.70 times faster than /usr/sbin/drill -p 2253 aaaa domain.tld @127.0.0.1 - 4.77 ± 6.86 times faster than bind9/bin/dig/dig -p 2253 aaaa domain.tld @127.0.0.1 - -==> Benchmarks for MX domain.tld. -Benchmark 1: bind9/bin/dig/dig -p 2253 mx domain.tld @127.0.0.1 - Time (mean ± σ): 9.8 ms ± 1.4 ms [User: 7.3 ms, System: 2.9 ms] - Range (min … max): 8.7 ms … 14.8 ms 327 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Benchmark 2: /usr/sbin/drill -p 2253 mx domain.tld @127.0.0.1 - Time (mean ± σ): 2.4 ms ± 0.1 ms [User: 1.7 ms, System: 0.6 ms] - Range (min … max): 2.2 ms … 3.0 ms 1312 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Benchmark 3: hickory-dns/target/release/resolve -n 127.0.0.1:2253 -t MX domain.tld - Time (mean ± σ): 1.9 ms ± 0.5 ms [User: 1.3 ms, System: 1.3 ms] - Range (min … max): 1.8 ms … 22.9 ms 1555 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Summary - hickory-dns/target/release/resolve -n 127.0.0.1:2253 -t MX domain.tld ran - 1.22 ± 0.35 times faster than /usr/sbin/drill -p 2253 mx domain.tld @127.0.0.1 - 5.10 ± 1.59 times faster than bind9/bin/dig/dig -p 2253 mx domain.tld @127.0.0.1 - -==> Benchmarks for CNAME mail.domain.tld. -Benchmark 1: bind9/bin/dig/dig -p 2253 mail.domain.tld @127.0.0.1 - Time (mean ± σ): 9.2 ms ± 0.4 ms [User: 6.9 ms, System: 2.7 ms] - Range (min … max): 8.6 ms … 11.7 ms 288 runs - -Benchmark 2: /usr/sbin/drill -p 2253 mail.domain.tld @127.0.0.1 - Time (mean ± σ): 2.4 ms ± 0.2 ms [User: 1.7 ms, System: 0.6 ms] - Range (min … max): 2.2 ms … 3.4 ms 1318 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Benchmark 3: hickory-dns/target/release/resolve -n 127.0.0.1:2253 mail.domain.tld - Time (mean ± σ): 2.0 ms ± 0.6 ms [User: 1.2 ms, System: 1.3 ms] - Range (min … max): 1.9 ms … 22.2 ms 1432 runs - - Warning: Statistical outliers were detected. Consider re-running this benchmark on a quiet system without any interferences from other programs. It might help to use the '--warmup' or '--prepare' options. - -Summary - hickory-dns/target/release/resolve -n 127.0.0.1:2253 mail.domain.tld ran - 1.18 ± 0.37 times faster than /usr/sbin/drill -p 2253 mail.domain.tld @127.0.0.1 - 4.63 ± 1.41 times faster than bind9/bin/dig/dig -p 2253 mail.domain.tld @127.0.0.1 - -==> All done - -==> Stopping Unbound diff --git a/unbound.conf b/unbound.conf index 9d3b92f..f6c8fa4 100644 --- a/unbound.conf +++ b/unbound.conf @@ -23,3 +23,8 @@ server: local-data: "domain.tld. AAAA ::1" local-data: "domain.tld. MX 10 mail.domain.tld." local-data: "mail.domain.tld CNAME domain.tld." + local-data: 'txt.domain.tld TXT "0Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."' + local-data: 'txt.domain.tld TXT "1Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."' + local-data: 'txt.domain.tld TXT "2Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."' + local-data: 'txt.domain.tld TXT "3Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."' + local-data: 'txt.domain.tld TXT "4Lorem ipsum dolor sit amet, consectetur adipiscing elit, sed do eiusmod tempor incididunt ut labore et dolore magna aliqua. Ut enim ad minim veniam, quis nostrud exercitation ullamco laboris nisi ut aliquip ex ea commodo consequat."'