plugin/forward: fast-path string comparison in isAllowedDomain (#8385)

* test: add benchmark cases for Request IP/Port and parseRequest

Signed-off-by: Manuel Rüger <manuel@rueg.eu>

* test(kubernetes): add BenchmarkServices and BenchmarkServicesHeadless

Signed-off-by: Manuel Rüger <manuel@rueg.eu>

* perf(forward): fast-path string comparison in isAllowedDomain

Signed-off-by: Manuel Rüger <manuel@rueg.eu>

---------

Signed-off-by: Manuel Rüger <manuel@rueg.eu>
This commit is contained in:
Manuel Rüger
2026-08-04 03:44:27 +02:00
committed by GitHub
parent d74404f8ac
commit a1642a64dc
3 changed files with 57 additions and 0 deletions

View File

@@ -63,3 +63,10 @@ func TestParseInvalidRequest(t *testing.T) {
}
const zone = "inter.webs.tests."
func BenchmarkParseRequest(b *testing.B) {
b.ReportAllocs()
for b.Loop() {
_, _ = parseRequest("1-2-3-4.webs.mynamespace.svc.inter.webs.tests.", zone, false)
}
}