ci: parallelize benchmark tests across 3 runners#54
Merged
Conversation
Split the single Benchmark Tests job into a matrix of 3 parallel jobs, one per package (controller, metrics, recommendation). This reduces wall-clock time from ~10 minutes (sum of all) to ~max(controller), roughly a 2-3x speedup. Each shard maintains its own baseline cache for benchstat comparison. Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
Further split the controller benchmark shard (8m41s) into two parallel jobs using -bench regex filtering: - controller-core: fast benchmarks (BuildPrometheusQuery, Reconcile, ComputeRecommendations) -- ~1 min expected - controller-scale: scale benchmarks (ManyWorkloads, ManyPolicies, ConcurrentPolicies up to 1000) -- the heavy tail Total shards: 4 (controller-core, controller-scale, metrics, recommendation) Expected wall-clock: max(controller-scale) instead of sum(all). Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
SebTardif
added a commit
that referenced
this pull request
May 26, 2026
Further split controller-scale (8m06s) into two parallel shards:
- controller-workloads: BenchmarkReconcile_ManyWorkloads
- controller-policies: BenchmarkReconcile_ManyPolicies + ConcurrentPolicies
Reduce max scale from {10,100,500,1000} to {10,50,100,250}.
250 catches the same O(n^2) regressions at 1/12th the cost of 1000
(1.6s vs 20s per iteration locally).
Total benchmark shards: 5 (was 4 after PR #54).
Signed-off-by: Sebastien Tardif <sebtardif@ncf.ca>
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.
Split the single Benchmark Tests job into a matrix of 3 parallel jobs, one per package (
controller,metrics,recommendation).Before: 1 runner, ~10 min (all 20 benchmarks sequential)
After: 3 runners in parallel, wall-clock = max(heaviest shard)
internal/controller/...internal/metrics/...internal/recommendation/...Each shard has its own baseline cache key (
bench-baseline-<pkg>-...) for independent benchstat comparison. The first merge to main after this PR will establish per-package baselines.ci-gatedepends ontest-bench, which with a matrix strategy already waits for all 3 shards to complete. No changes needed there.