test(coraza): add middleware performance benchmarks#2007
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (1)
📜 Recent review details⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (1)
🔇 Additional comments (8)
📝 WalkthroughWalkthroughThis PR introduces a complete benchmark suite for the Coraza WAF middleware, comparing performance across different rule configurations, request sizes, and processing layers. The benchmarks measure baseline Fiber request handling, WAF processing with varying rules and payloads, request conversion to standard HTTP, and metrics collection both sequentially and in parallel. ChangesCoraza Benchmarks
Estimated code review effort🎯 2 (Simple) | ⏱️ ~12 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Poem
🚥 Pre-merge checks | ✅ 4 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (4 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
Warning There were issues while running some tools. Please review the errors and either fix the tool's configuration or disable the tool if it's a critical failure. 🔧 golangci-lint (2.12.2)level=error msg="[linters_context] typechecking error: pattern ./...: directory prefix . does not contain main module or its selected dependencies" Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
This PR adds reproducible benchmarks for the Coraza middleware hot path.
Benchmarks added
net/httpadapter benchmarksprocessRequestbenchmarks from*http.RequestSample local results
Environment:
BenchmarkFiberBaseline_GETBenchmarkCoraza_NoRules_GETBenchmarkCoraza_QueryRule_GET_AllowBenchmarkCoraza_QueryRule_GET_BlockBenchmarkCoraza_BodyRule_POST_1KB_AllowBenchmarkCoraza_BodyRule_POST_1KB_BlockBenchmarkCoraza_BodyRule_POST_64KB_AllowBenchmarkCoraza_ManyHeaders_GETBenchmarkConvertFiberToStdRequest_GETBenchmarkConvertFiberToStdRequest_POST_1KBBenchmarkProcessRequest_FromStdRequest_GETBenchmarkProcessRequest_FromStdRequest_POST_1KBBenchmarkCorazaTransaction_Direct_GETBenchmarkCorazaTransaction_Direct_POST_1KBBenchmarkDefaultMetricsCollector_ObserveRequestBenchmarkDefaultMetricsCollector_ObserveRequestParallelThese numbers are included as a local sample only.
Initial observations
46.7 us/op,38 KB/op, and84 allocs/opover the plain Fiber baseline in this local run.0 allocs/opand does not appear to be a meaningful bottleneck.Summary by CodeRabbit