Skip to content

Add sqlclient-perf-pr pipeline comparing against main branch source - #4519

Open
cheenamalhotra wants to merge 1 commit into
mainfrom
dev/cheena/turbo-journey
Open

Add sqlclient-perf-pr pipeline comparing against main branch source#4519
cheenamalhotra wants to merge 1 commit into
mainfrom
dev/cheena/turbo-journey

Conversation

@cheenamalhotra

@cheenamalhotra cheenamalhotra commented Aug 8, 2026

Copy link
Copy Markdown
Member

Summary

Introduces a PR-oriented variant of the perf pipeline: eng/pipelines/perf/sqlclient-perf-pr-pipeline.yml.

Pipeline in ADO: sqlclient-perf-pr
Purpose: To be used to run perf tests to capture benchmarks for PRs, personal braches, and publish comparison results locally against dotnet/sqlclient:main branch.

It extends the same v1/Perf.Test.Job.yml@PerfTemplates template and exposes the same configuration options as sqlclient-perf-pipeline.yml (platform, framework, run mode, confirmation runs, regression threshold/gate, managed SNI, optimized async behaviour, connection pool V2), but:

  • Runs on the branch the run is queued on — manual/queue-time only (pr: none, trigger: none).
  • Uses main branch source code as the baseline instead of a released NuGet package.
  • Does not ingest results into Kusto — no ADX variable group, no translate/publish/ingest steps.

Source baseline mechanism

The perf template only exposes post-test steps, so both benchmark passes must happen inside the on-VM script. The run scripts therefore gain a second, mutually-exclusive baseline selector:

Script New arguments
run-perf-tests.sh --baseline-source-ref, --baseline-repo-url
run-perf-tests.ps1 -BaselineSourceRef, -BaselineRepoUrl

When a source ref is given, the script materialises that ref outside the checkout (so it can never be picked up by the candidate build or the results copy-back):

  1. git fetch --no-tags --depth 1 origin '+refs/heads/<ref>:refs/remotes/perfbaseline/<ref>' + git worktree add --detach — uses the copied checkout's own origin.
  2. Falls back to git clone --quiet --depth 1 --branch <ref> <baselineRepoUrl> when the tree arrived without .git or origin needs credentials the VM lacks.

The baseline pass then builds that ref's own PerformanceTests project, whose default ProjectReference points at that ref's driver source. This keeps interleave_perf.py's --baseline-exe-dir / --current-exe-dir contract unchanged, and both passes still use the same injected RUNNER_CONFIG / DATATYPES_CONFIG so configuration is identical on both sides.

The comparison is labelled <ref>@<sha> (e.g. main@9b20e5ec3) so each run records exactly which baseline commit it measured against.

The existing package baseline (--baseline-version -> ReferenceType=Package + MdsPackageVersion) is unchanged; supplying both selectors fails fast.

Verification

  • bash -n on run-perf-tests.sh; PowerShell parser check on run-perf-tests.ps1
  • YAML parse of the new pipeline
  • Both git-acquisition paths smoke-tested (origin fetch and clone fallback), incl. a fix for .git being a file in a worktree
  • Out-of-tree baseline build: dotnet build of the perf project from a detached worktree into a separate output dir — 0 warnings, 0 errors, ~13s

Notes for reviewers

  • The new pipeline still needs to be registered in Azure DevOps pointing at eng/pipelines/perf/sqlclient-perf-pr-pipeline.yml.
  • End-to-end validation requires the Perf Test Lab VM; the first real run should exercise both the .git-present path and the GitHub clone fallback.
  • If a PR adds or removes benchmarks, compare_perf.py reports them as new / removed rather than failing.

Checklist

  • Tests added or updated — n/a (pipeline/infra change; scripts smoke-tested as above)
  • Public API changes documented — n/a, no public API change
  • Verified against customer repro (if applicable) — n/a
  • Ensure no breaking changes introduced — existing sqlclient-perf pipeline and its package-baseline path are unchanged
  • Documentation updated — eng/pipelines/perf/README.md covers both pipelines, the source-baseline mechanism, PR-only parameters, and new troubleshooting entries

Introduces eng/pipelines/perf/sqlclient-perf-pr-pipeline.yml, a PR-oriented
variant of the perf pipeline. It extends the same Perf.Test.Job.yml template and
exposes the same configuration options, but:

* runs against the branch the run is queued on (manual/queue-time only),
* uses the 'main' branch SOURCE as the baseline instead of a released package,
* does not ingest results into Kusto (no ADX variable group, no translate/
  publish/ingest steps).

To support this, the on-VM run scripts gain a second baseline selector:

* run-perf-tests.sh: --baseline-source-ref / --baseline-repo-url
* run-perf-tests.ps1: -BaselineSourceRef / -BaselineRepoUrl

The selector is mutually exclusive with the existing package baseline. The
baseline ref is materialised outside the checkout (git worktree from the
checkout's origin, falling back to a shallow clone) and that ref's own
PerformanceTests project is built, so the measured driver is the baseline
source. The comparison is labelled '<ref>@<sha>' so the exact baseline commit
is recorded.

README documents both pipelines, the source-baseline mechanism, the PR-only
parameters, and new troubleshooting entries.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 08b18803-3735-44b6-8afc-1996ef05fe15
Copilot AI lite review requested due to automatic review settings August 8, 2026 06:18
@github-project-automation github-project-automation Bot moved this to To triage in SqlClient Board Aug 8, 2026
@cheenamalhotra cheenamalhotra added this to the 7.1.0-preview3 milestone Aug 8, 2026

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

Adds a PR-oriented performance pipeline that runs the existing SqlClient perf benchmark suite against the queued branch (“current”) and compares it to a source baseline from another ref in this repo (default main), without ingesting results into Kusto. This fits into the existing eng/pipelines/perf/ perf automation by reusing the same Perf Test Lab extends template and the same on-VM run scripts.

Changes:

  • Introduces sqlclient-perf-pr-pipeline.yml, a manual-only perf pipeline variant using source-baseline comparison and publishing artifacts/summaries only (no Kusto).
  • Extends the on-VM run scripts (run-perf-tests.sh / .ps1) with a mutually-exclusive baseline selector that can materialize/build a baseline from another git ref’s source.
  • Updates perf pipeline documentation to describe the new PR pipeline and the new baseline-source mechanism.

Reviewed changes

Copilot reviewed 4 out of 4 changed files in this pull request and generated no comments.

File Description
eng/pipelines/perf/sqlclient-perf-pr-pipeline.yml New manual-only PR perf pipeline wiring source-baseline parameters into the existing PerfTemplates job, omitting Kusto steps.
eng/pipelines/perf/scripts/run-perf-tests.sh Adds --baseline-source-ref / --baseline-repo-url support and refactors baseline execution to allow package or source baselines.
eng/pipelines/perf/scripts/run-perf-tests.ps1 Windows equivalent support for source-baseline acquisition (origin fetch/worktree + clone fallback) and baseline execution refactor.
eng/pipelines/perf/README.md Documents the PR pipeline, source-baseline behavior, and troubleshooting updates.

💡 Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.

@cheenamalhotra
cheenamalhotra marked this pull request as ready for review August 8, 2026 06:33
@cheenamalhotra
cheenamalhotra requested a review from a team as a code owner August 8, 2026 06:33
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: To triage

Development

Successfully merging this pull request may close these issues.

5 participants