FEAT: Add CI perf baseline regression detection & insertmanyvalues benchmark#527
FEAT: Add CI perf baseline regression detection & insertmanyvalues benchmark#527bewithgaurav wants to merge 7 commits intomainfrom
Conversation
…n, CI artifact pipeline - Add insertmanyvalues scenario (100K rows, 1000/batch, GH #500 repro) - Add --baseline flag for 3-way comparison (main vs PR vs pyodbc) - Add --json flag to save results for pipeline artifact consumption - Publish benchmark results as CI artifact on main merge - Download baseline artifact on PR runs for automatic regression detection - Fix timing: time.time() -> time.perf_counter() - Move connection setup outside timing window (measure execute+fetch only)
📊 Code Coverage Report
Diff CoverageDiff: main...HEAD, staged and unstaged changesNo lines with coverage information in this diff. 📋 Files Needing Attention📉 Files with overall lowest coverage (click to expand)mssql_python.pybind.logger_bridge.cpp: 59.2%
mssql_python.pybind.ddbc_bindings.h: 67.8%
mssql_python.row.py: 70.5%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python.pybind.ddbc_bindings.cpp: 74.2%
mssql_python.pybind.connection.connection.cpp: 75.8%
mssql_python.__init__.py: 77.3%
mssql_python.ddbc_bindings.py: 79.6%
mssql_python.pybind.connection.connection_pool.cpp: 79.6%
mssql_python.connection.py: 85.2%🔗 Quick Links
|
There was a problem hiding this comment.
Pull request overview
This PR enhances CI performance benchmarking by generating JSON benchmark outputs, adding optional baseline comparisons against main, and introducing an insertmanyvalues-style insert benchmark alongside existing fetch/query scenarios.
Changes:
- Update CI to run
benchmarks/perf-benchmarking.pywith--baseline ... --json ...and publish benchmark results as a pipeline artifact. - Add logic to download a baseline artifact from the latest
mainrun for PR comparisons. - Extend the benchmark script with baseline/JSON support, updated reporting, and a new insertmanyvalues benchmark scenario.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
| eng/pipelines/pr-validation-pipeline.yml | Runs benchmarks with baseline/JSON flags and adds publish/download artifact steps intended to enable baseline comparisons in CI. |
| benchmarks/perf-benchmarking.py | Adds argparse-driven baseline + JSON I/O, improves output formatting, and adds an insertmanyvalues benchmark scenario. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
- Download and restore AdventureWorks2022 via docker cp + sqlcmd - Install pyodbc and run perf-benchmarking.py with --baseline/--json - Publish/download baseline artifacts (perf-baseline-macOS-SQL2022/SQL2025) - Same pattern as Windows, adapted for Colima Docker
… handle empty baseline
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 7 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
…ux conditional baseline
There was a problem hiding this comment.
Pull request overview
Copilot reviewed 5 out of 5 changed files in this pull request and generated 4 comments.
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Work Item / Issue Reference
Summary
This pull request enhances the performance benchmarking process in the CI pipeline by adding support for baseline comparison and automated artifact publishing and retrieval. The main improvements are focused on making benchmark results reproducible and comparable across pull requests and main branch runs.
Performance benchmarking improvements:
benchmarks/perf-benchmarking.py) is now run with--baseline benchmark_baseline.json --json benchmark_results.jsonarguments, enabling baseline comparison and outputting results in JSON format. [1] [2]Artifact management for benchmarks:
benchmark_results.json) as a pipeline artifact namedperf-baseline-$(sqlVersion)when running on themainbranch. This artifact serves as the baseline for future comparisons.mainbranch for pull request runs, enabling direct comparison of current benchmark results against the established baseline.