Repository navigation
Reuse benchmark builds within each CI pipeline run - #2222
Merged
LoopedBard3 merged 2 commits intoOct 26, 2026
Merged
Conversation
Cache application and supporting builds for container, gRPC, HttpClient, SignalR, and WebSocket matrices using run-scoped source and build keys. Isolate Docker and compression variants, document the cache lifecycle, and add configuration regression coverage. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d203afa3-f8a9-47b3-9353-e38e91a647e9
There was a problem hiding this comment.
🟡 Changes recommended
Shared Docker tags allow interleaved pipeline runs to reuse another run’s images despite run-scoped cache keys.
1 open issue
What changed in this PR
This PR adds per-pipeline build reuse to five benchmark matrices, reducing repeated compilation while preserving benchmark durations and result-storage settings.
Changes:
- Adds run-scoped source and build cache profiles and wires them into CI templates.
- Separates build variants by Docker image, gRPC implementation, framework, and WebSocket compression.
- Adds configuration regression tests and documents cache lifetime and excluded suites.
| File | Description |
|---|---|
| scenarios/containers.benchmarks.yml | Gives ASP.NET Docker variants distinct image names. |
| build/websocket-scenarios.yml | Enables run-scoped WebSocket build reuse. |
| build/tests/test_build_reuse.py | Tests profile wiring, cache isolation, and compatible reuse. |
| build/signalr-scenarios.yml | Enables SignalR server and shared client build reuse. |
| build/README.md | Documents caching behavior, lifetime, and validation. |
| build/job-variables.yml | Defines the shared cache-profile configuration URL. |
| build/httpclient-scenarios.yml | Enables build reuse for GET and POST matrices. |
| build/grpc-scenarios.yml | Adds implementation identities and enables build reuse. |
| build/containers-scenarios.yml | Enables container application and database build reuse. |
| build/build-reuse.profile.yml | Defines cache identities and input validation for five suites. |
Review effort: Balanced
Remove the shared cache profile and standalone configuration test harness. Keep per-run source and build identities directly in existing templates, and suffix cached container and gRPC Go image names with the pipeline build ID to prevent interleaved runs from sharing mutable tags. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: d203afa3-f8a9-47b3-9353-e38e91a647e9
LoopedBard3
marked this pull request as ready for review
October 22, 2026 19:03
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
Avoid rebuilding the same benchmark applications for every matrix entry. Fortunes FastHttp currently spends roughly 42 seconds rebuilding the application for each size/rate combination, despite the load phase being only 15 seconds of warmup plus 15 seconds of measurement.
Build.BuildId, refreshing sources/builds for each pipeline run while reusing compatible variants on each agent.The branch is based on
aspnet/Benchmarksmain.Validation
Configuration-only validation used the existing Crank CLI without running benchmark agents:
Deployment considerations
No live benchmark timing run has been performed; actual wall-time savings still need to be measured after deployment. Retained builds and images rely on the agents' existing cleanup/restart policy; this change does not add a cache TTL.