Skip to content

CHORE: Add a multi-chunk LOB scenario to PR performance reports - #813

Merged
Gaurav Sharma (bewithgaurav) merged 10 commits into
mainfrom
bewithgaurav/lob-profiler-coverage
Sep 25, 2026
Merged

Gaurav Sharma (bewithgaurav) merged 10 commits into
mainfrom
bewithgaurav/lob-profiler-coverage

Conversation

@bewithgaurav

Copy link
Copy Markdown
Collaborator

Work Item / Issue Reference

GitHub Issue: #554

Summary

Add one scenario that fetches a single 256 KiB VARCHAR(MAX) value through
fetchall(), bringing routine profiler coverage from 20 to 21 scenarios.

Validate the exact payload outside the timed fetch window and show available
diagnostic-call counts without treating missing instrumentation as zero.

No runtime driver changes, additional builds, platform changes, or regression
threshold changes.

Exercise VARCHAR(MAX), NVARCHAR(MAX), and VARBINARY(MAX) at 64 and 256 KiB through fetchone, fetchmany(1), and fetchall. Validate exact payloads outside the timed fetch window and expose available diagnostic-call counts without treating missing instrumentation as zero. Preserve existing thresholds, advisory behavior, and platform selection.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Keep one 256 KiB VARCHAR(MAX) fetchall workload, bringing the fixed registry to 21 tasks. Remove the unused type, size and API matrix while retaining exact payload checks and diagnostic-call visibility.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI lite review requested due to automatic review settings September 24, 2026 07:20
@github-actions github-actions Bot added the pr-size: medium Moderate update size label Sep 24, 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.

Copilot review overview

🟡 Changes recommended

Two moderate issues remain unresolved in profiler cleanup and diagnostic instrumentation/reporting.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 Medium severity

Open (1)
What changed in this PR

Adds a 256 KiB VARCHAR(MAX) fetchall() profiler scenario, updating reporting, tests, and documentation for 21 scenarios.

Changes:

  • Adds and validates the multi-chunk LOB workload.
  • Updates diagnostic reporting and scenario coverage.
  • Documents measurement boundaries and limitations.
File Summary
tests/​test_036_profiler_ci.py Adds workload and reporting coverage.
eng/​profiler_benchmarks/​workloads.py Adds the LOB workload; ctx.enable() should be protected by try/finally to prevent state contamination. (Moderate, 1 vote)
eng/​profiler_benchmarks/​report.py Adds diagnostic-count handling; the SQLGetDiagRec branch is unreachable without instrumentation. (Moderate, 2 votes)
eng/​profiler_benchmarks/​README.md Documents coverage and measurement behavior.

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

Comment thread eng/profiler_benchmarks/report.py Outdated
Use existing generic counter reporting and keep the benchmark README change to the scenario count and a short workload description.

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Copilot AI review requested due to automatic review settings September 24, 2026 07:26
@bewithgaurav
Gaurav Sharma (bewithgaurav) marked this pull request as ready for review September 24, 2026 07:26
@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

PR Performance Report

✅ No regression detected

No consistent slowdowns detected across all 2 environments.

0 IMPROVEMENTS 0 SLOWDOWNS 2/2 ENVIRONMENTS

Coverage: 2 of 2 environments completed. Advisory result; does not block merging.

Performance diagnostics

Phase times are inclusive diagnostics and must not be added together. They identify where measured time changed, not why it changed.

No affected phases or call-count changes were recorded.

All database tasks and timings

Unix / SQL Server 2022

Database task Before After Paired change Result
Connection opening 10.921 ms 10.892 ms +0.5% no signal
SELECT queries 1.062 ms 1.021 ms -3.8% no signal
Row insertion 31.668 ms 31.551 ms -0.6% no signal
Executemany inserts 137.076 ms 136.176 ms -0.2% no signal
Fetch-all queries 124.638 ms 117.893 ms -5.4% no signal
Row-by-row fetching 12.637 ms 12.608 ms -0.9% no signal
Batched row fetching 111.081 ms 112.173 ms +1.4% no signal
Transaction commit and rollback 100.342 ms 104.437 ms +4.7% no signal
Arrow row fetching 89.892 ms 91.196 ms +2.2% no signal
100,000-row insertion 439.748 ms 413.443 ms -3.8% no signal
Row fetching in batches of 100 108.466 ms 109.691 ms +1.1% no signal
Row fetching in batches of 10,000 117.691 ms 134.682 ms +16.3% no signal
Repeated positional queries 30.183 ms 30.922 ms +2.4% no signal
Repeated named-parameter queries 32.463 ms 32.909 ms +1.4% no signal
Legacy 100,000-row insertion 307.231 ms 307.208 ms -0.9% no signal
Insertion with explicit input sizes 443.257 ms 432.540 ms -1.4% no signal
Joined aggregation queries 184.863 ms 184.924 ms +0.2% no signal
Large joined-result fetching 177.773 ms 178.564 ms -0.5% no signal
1.2-million-row fetching 3504.976 ms 3471.509 ms -0.5% no signal
Common table expression queries 5.591 ms 5.585 ms -0.5% no signal
256 KiB VARCHAR(MAX) / fetchall() 1.262 ms 1.279 ms +0.2% no signal

Unix / SQL Server 2025

Database task Before After Paired change Result
Connection opening 96.075 ms 96.496 ms +0.5% no signal
SELECT queries 1.083 ms 1.256 ms +16.0% no signal
Row insertion 31.841 ms 34.161 ms +7.6% no signal
Executemany inserts 131.452 ms 131.089 ms -0.2% no signal
Fetch-all queries 116.419 ms 115.088 ms -1.7% no signal
Row-by-row fetching 12.760 ms 12.905 ms -0.1% no signal
Batched row fetching 110.637 ms 109.642 ms -0.9% no signal
Transaction commit and rollback 103.474 ms 103.322 ms -0.8% no signal
Arrow row fetching 87.564 ms 88.469 ms -0.4% no signal
100,000-row insertion 389.020 ms 431.633 ms +10.1% no signal
Row fetching in batches of 100 106.091 ms 105.637 ms -0.4% no signal
Row fetching in batches of 10,000 117.761 ms 132.632 ms -1.4% no signal
Repeated positional queries 30.907 ms 30.295 ms -1.5% no signal
Repeated named-parameter queries 33.059 ms 33.135 ms +0.1% no signal
Legacy 100,000-row insertion 304.258 ms 338.725 ms +3.1% no signal
Insertion with explicit input sizes 432.499 ms 431.580 ms +1.2% no signal
Joined aggregation queries 169.941 ms 168.857 ms -1.0% no signal
Large joined-result fetching 179.175 ms 178.548 ms +0.7% no signal
1.2-million-row fetching 3516.432 ms 3560.276 ms +2.0% no signal
Common table expression queries 5.287 ms 5.265 ms -0.7% no signal
256 KiB VARCHAR(MAX) / fetchall() 1.388 ms 1.388 ms +1.0% no signal
Build and measurement details

ADO build 178002

PR head: 26075a47327ce07b7fb11097da7a72c90901a891
Base: 29fa5546eb7f24df0d5d42276549aa789937880d
Measured merge: d4522a39de1421ce5d8de560ac6981c4e2227b02

  • Unix / SQL Server 2022: Python 3.12.3, x86_64, SQL 16.0.4295.3; 5 paired comparisons and 1 warmup.
  • Unix / SQL Server 2025: Python 3.12.3, x86_64, SQL 17.0.5005.3; 5 paired comparisons and 1 warmup.

A consistent change requires more than 20% median paired movement, at least 1 ms between the median runtimes, and at least 80% of pairs exceeding the relative threshold in the same direction. A slowdown without enough pair agreement is reported as inconsistent.

The displayed change is the median of paired before-and-after ratios. It is not recalculated from the two displayed median runtimes.

Both revisions use profiling-enabled builds on the same agent and database, with alternating order and discarded warmups. Results are diagnostic and do not represent production-wheel latency.

Raw samples and logs are attached to the ADO run as profiler-* artifacts.

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.

Copilot review overview

🔵 Needs a closer look

A moderate test assertion does not verify the exact advertised SQL expression and repeat count.

Review effort: Lite
Findings: 1 Medium severity

Open (1)

Copilot AI review requested due to automatic review settings September 24, 2026 07:29

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.

Copilot review overview

🟢 Approval recommended

No unresolved review issues remain.

Review effort: Lite
Findings: 1 Medium severity

Open (1)

@github-actions

github-actions Bot commented Sep 24, 2026 •

Copy link
Copy Markdown

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

84%


📈 Total Lines Covered: 9358 out of 11042
📁 Project: mssql-python


Diff Coverage

Diff: main...HEAD, staged and unstaged changes

No lines with coverage information in this diff.


📋 Files Needing Attention

📉 Files with overall lowest coverage (click to expand)
mssql_python.pybind.performance_counter.hpp: 0.7%
mssql_python.pybind.logger_bridge.cpp: 57.9%
mssql_python.pybind.ddbc_bindings.h: 62.6%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python.pybind.ddbc_bindings.cpp: 79.1%
mssql_python.pybind.connection.connection_pool.cpp: 82.3%
mssql_python.pybind.connection.connection.cpp: 83.1%
mssql_python.logging.py: 86.2%
mssql_python.pooling.py: 90.1%
mssql_python.pybind.fetch_temporal.hpp: 92.1%

🔗 Quick Links

⚙️ Build Summary 📋 Coverage Details

View Azure DevOps Build

Browse Full Coverage Report

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.

Copilot review overview

🔵 Needs a closer look

The LOB test does not assert that the query requests the complete 262,144-byte payload.

Review effort: Lite
Findings: None

Resolved since last review (1)

Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>

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.

Copilot review overview

🟡 Changes recommended

Wrap the overlong assertion to satisfy the repository’s formatting check.

Get a fresh assessment by requesting another Copilot review.

Review effort: Lite
Findings: 1 High severity

Open (1)

Comment thread tests/test_036_profiler_ci.py Outdated
Copilot AI review requested due to automatic review settings September 24, 2026 10:23

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.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified.

Review effort: Lite
Findings: None

Resolved since last review (1)

Copilot AI review requested due to automatic review settings September 24, 2026 15:11

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.

Copilot review overview

🟢 Approval recommended

The reviewed changes are complete and introduce no unresolved approval blockers.

Review effort: Lite
Findings: None

Copilot AI review requested due to automatic review settings September 24, 2026 17:50

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.

Copilot review overview

🟢 Approval recommended

No unresolved blocking issues were identified.

Review effort: Lite
Findings: None

@gargsaumya gargsaumya 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.

LGTM

@bewithgaurav
Gaurav Sharma (bewithgaurav) merged commit 3089361 into main Sep 25, 2026
32 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

pr-size: medium Moderate update size

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants