feat: add Go benchmarks for reconciliation hot paths#2035
Draft
maksymvavilov wants to merge 6 commits into
Draft
feat: add Go benchmarks for reconciliation hot paths#2035maksymvavilov wants to merge 6 commits into
maksymvavilov wants to merge 6 commits into
Conversation
Signed-off-by: Maskym Vavilov <mvavilov@redhat.com>
Add benchmark functions for the 5 identified hot paths: effective policy calculation, topology ToDot serialization, AuthConfig building, Limitador limits building, and topology Paths() traversal. Includes a Makefile test-bench target and a GitHub Actions workflow that posts benchstat comparisons as PR comments. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Maskym Vavilov <mvavilov@redhat.com>
|
Important Review skippedDraft detected. Please check the settings in the CodeRabbit UI or the ⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: You can disable this status message by setting the Use the checkbox below for a quick retry:
✨ Finishing Touches🧪 Generate unit tests (beta)
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 |
… docs - Fix struct field alignment flagged by gofmt -s - Handle base branch not having test-bench target yet by falling back to raw go test command - Remove design doc .md files from PR Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Maskym Vavilov <mvavilov@redhat.com>
Add 8 benchmarks from Mike Nairn's PR Kuadrant#2031 covering scaling dimensions not in the original set: listener fanout, multi-gateway, RateLimitPolicy, TokenRateLimitPolicy, GetKuadrantFromTopology lookup, topology build cost, multi-reconciler cycle, and full reconciliation cycle. Enhance topology builder with listenersPerGW, per-route policy attachment, and TokenRateLimitPolicy support. Co-Authored-By: Mike Nairn <mnairn@redhat.com> Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Maskym Vavilov <mvavilov@redhat.com>
- Decouple benchmarks from unit tests with //go:build bench tag - Remove redundant sub-benchmarks: TokenRateLimitPolicies (same code path as RateLimitPolicies), MultiReconcilerCycle (subset of FullReconciliationCycle), and oversized cases (1000-route, 64-listener) - Bump -count from 6 to 10 for benchstat statistical significance - Total suite runs in ~10.7 minutes with 40 sub-benchmarks, all with iters >= 2 Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Maskym Vavilov <mvavilov@redhat.com>
- Target only ./internal/controller/... instead of all UNIT_DIRS to avoid scanning unrelated packages - Reuse make test-bench for base branch in CI workflow instead of duplicating the go test command Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com> Signed-off-by: Maskym Vavilov <mvavilov@redhat.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Go benchmarks for reconciliation hot paths with a CI workflow that posts benchstat comparisons on PRs. 11 benchmark functions, 40 sub-benchmarks, ~10.7 min total runtime.
Benchmarks
All benchmarks use the
benchbuild tag (//go:build bench), fully decoupled from unit tests.CalculateEffectiveAuthPoliciesEffectiveRateLimitPoliciesEffectiveAuthPoliciesListenerFanoutEffectiveAuthPoliciesMultiGatewayTopologyToDotBuildDesiredAuthConfigBuildLimitadorLimitsTopologyPathsGetKuadrantFromTopologyTopologyBuildFullReconciliationCycleRunning
CI Workflow
.github/workflows/benchmark.yamlruns on PRs touchinginternal/,pkg/,api/,go.mod:-count=10)Credits
Scaling benchmarks (listener fanout, multi-gateway, RLP, topology build, full cycle) adapted from Mike Nairn's PR #2031.
🤖 Generated with Claude Code