From 06d16959eee7fb90fdd672761210f3bb6032bfbb Mon Sep 17 00:00:00 2001 From: Brian Cunnie Date: Thu, 24 Jul 2025 06:45:42 -0700 Subject: [PATCH] Blocklist is 3% - 12% performance penalty I measured the performance penalty of the 725-entry blocklist, and it clocks in a 3% to 12%. I want to replace the painful for-loop with a map, assuming the map works more quickly. --- integration_speed_test.go | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/integration_speed_test.go b/integration_speed_test.go index 3b94e6e..cd2318a 100644 --- a/integration_speed_test.go +++ b/integration_speed_test.go @@ -37,7 +37,7 @@ var _ = Describe("speed", func() { var loopbackAddr *net.UDPAddr var conn *net.UDPConn var msg dnsmessage.Message - const numQueries = 5000 + const numQueries = 5000 // set to 123456 when testing const minThroughput = 1000 BeforeEach(func() { @@ -64,10 +64,17 @@ var _ = Describe("speed", func() { // - queries are done sequentially, not in parallel // - each query includes an overhead of 4 Expect() // current max queries is 2047/second (ns-ovh.sslip.io.) + // ~27k Apple M4 // ~19k Apple M2 // ~8k vSphere Xeon D-1736 2.7GHz // ~6k AWS Graviton T2 // ~5k Azure Xeon E5-2673 v4 @ 2.30GHz + + // blocklist exacts a 3% - 11% penalty + // with `-quiet` and 4-entry blocklist on M4 + // ~32k-34k + // with 725 entry blocklist + // ~30k-31k for i := 0; i < numQueries; i += 1 { bytesWritten, err := conn.Write(queryBuf) Expect(err).ToNot(HaveOccurred())