Skip to content

AI: Strengthen Perf Police investigation and evidence guidance - #835

Open
Jahnvi Thakkar (jahnvi480) wants to merge 4 commits into
mainfrom
jahnvi/perf-police-investigation-guidance
Open

Jahnvi Thakkar (jahnvi480) wants to merge 4 commits into
mainfrom
jahnvi/perf-police-investigation-guidance

Conversation

@jahnvi480

@jahnvi480 Jahnvi Thakkar (jahnvi480) commented Oct 8, 2026 •

Copy link
Copy Markdown
Contributor

Work Item / Issue Reference

AB#48077

GitHub Issue: N/A


Summary

Strengthen the reusable Perf Police agent and performance-review/profiling skills with a generic, evidence-led investigation method rather than PR-specific case studies.

  • Define the problem, trace actual dispatch, test falsifiable explanations, and assess the smallest fix that preserves surrounding behavior.
  • Preserve ownership, diagnostics, Python customization, converter behavior, invalidation, and cleanup when simplifying hot paths.
  • Distinguish fixture and harness failures from driver defects, and preserve meaningful coverage when consolidating tests.
  • Verify effective Release builds and native imports; separate source checks, native correctness, profiling attribution, and uninstrumented latency. Keep paired statistics, pyodbc comparisons, and CI provenance explicit.
  • Keep execution proportionate: clear review-to-coding handoffs, one shared-runtime owner, bounded resources, verified cleanup, and no redundant approval rounds within an authorized scope.

Changes are limited to three agent/skill Markdown files. No driver, benchmark, pipeline, workload, or threshold implementation changes are included.

Validation: git diff --check passed. Frontmatter, relative links/anchors, ASCII text, and code fences were checked. Native builds and SQL tests were not run because this is a documentation-only change.

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 8, 2026 14:24
@github-actions github-actions Bot added the pr-size: medium Moderate update size label Oct 8, 2026
@github-actions

github-actions Bot commented Oct 8, 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.270 ms 10.332 ms +0.6% no signal
SELECT queries 1.006 ms 1.005 ms -2.3% no signal
Row insertion 32.270 ms 32.265 ms -0.1% no signal
Executemany inserts 159.883 ms 159.190 ms -0.9% no signal
Fetch-all queries 119.781 ms 120.231 ms +0.5% no signal
Row-by-row fetching 4.984 ms 4.999 ms -0.1% no signal
Batched row fetching 116.426 ms 117.086 ms -0.2% no signal
Transaction commit and rollback 106.509 ms 105.461 ms -0.1% no signal
Arrow row fetching 89.631 ms 89.573 ms +0.0% no signal
100,000-row insertion 465.964 ms 466.917 ms -1.0% no signal
Row fetching in batches of 100 120.176 ms 122.615 ms -0.0% no signal
Row fetching in batches of 10,000 138.238 ms 127.439 ms -7.7% no signal
Repeated positional queries 33.466 ms 33.630 ms +1.0% no signal
Repeated named-parameter queries 35.966 ms 35.700 ms -0.8% no signal
Legacy 100,000-row insertion 347.871 ms 346.213 ms -0.5% no signal
Insertion with explicit input sizes 502.156 ms 508.720 ms +1.5% no signal
Joined aggregation queries 181.327 ms 180.523 ms -0.8% no signal
Large joined-result fetching 189.788 ms 191.072 ms +0.3% no signal
1.2-million-row fetching 3486.090 ms 3502.413 ms +0.3% no signal
Common table expression queries 5.380 ms 5.396 ms +0.3% no signal
256 KiB VARCHAR(MAX) / fetchall() 1.565 ms 1.619 ms +3.4% no signal
10,000 scalar values / fetchval() (debug disabled) 17.054 ms 16.970 ms -0.3% no signal
10,000 output-converted rows / fetchall() 19.079 ms 19.800 ms +5.1% no signal
10,000 output-converted rows / fetchmany(1000) 23.777 ms 24.275 ms +1.8% no signal
10,000 rows x 32 columns / dict(row._mapping) (warm) 32.555 ms 31.941 ms -1.6% no signal

Unix / SQL Server 2025

Database task Before After Paired change Result
Connection opening 98.607 ms 98.530 ms -0.1% no signal
SELECT queries 1.046 ms 1.047 ms +0.4% no signal
Row insertion 33.258 ms 33.704 ms +1.3% no signal
Executemany inserts 151.924 ms 156.625 ms +3.5% no signal
Fetch-all queries 119.650 ms 121.543 ms +1.8% no signal
Row-by-row fetching 4.938 ms 4.923 ms +0.1% no signal
Batched row fetching 116.916 ms 117.997 ms +0.9% no signal
Transaction commit and rollback 110.618 ms 110.893 ms +0.2% no signal
Arrow row fetching 89.100 ms 90.213 ms -0.2% no signal
100,000-row insertion 467.384 ms 447.402 ms +0.9% no signal
Row fetching in batches of 100 120.571 ms 122.725 ms +2.3% no signal
Row fetching in batches of 10,000 126.323 ms 142.339 ms +12.4% no signal
Repeated positional queries 34.486 ms 33.980 ms -0.9% no signal
Repeated named-parameter queries 36.697 ms 36.578 ms -0.3% no signal
Legacy 100,000-row insertion 367.694 ms 345.865 ms -7.0% no signal
Insertion with explicit input sizes 480.153 ms 491.019 ms +2.3% no signal
Joined aggregation queries 163.234 ms 167.154 ms +3.0% no signal
Large joined-result fetching 194.635 ms 189.675 ms -3.4% no signal
1.2-million-row fetching 3494.776 ms 3505.065 ms +0.1% no signal
Common table expression queries 5.350 ms 5.281 ms -3.3% no signal
256 KiB VARCHAR(MAX) / fetchall() 2.052 ms 1.456 ms -18.3% no signal
10,000 scalar values / fetchval() (debug disabled) 16.808 ms 16.903 ms +0.3% no signal
10,000 output-converted rows / fetchall() 19.809 ms 19.388 ms -2.6% no signal
10,000 output-converted rows / fetchmany(1000) 23.885 ms 23.307 ms -2.4% no signal
10,000 rows x 32 columns / dict(row._mapping) (warm) 30.906 ms 31.556 ms +2.1% no signal
Build and measurement details

ADO build 191085

PR head: 4faa90683e26dbedccd6074de1ab07e62c8d3f86
Base: 730cb2bec05c650b1dba069bf9cbbadb810291d9
Measured merge: ce60594701c5c68bc0811b63d7ba91ddc43dce3b

  • Unix / SQL Server 2022: Python 3.12.3, x86_64, SQL 16.0.4315.2; 5 paired comparisons and 1 warmup.
  • Unix / SQL Server 2025: Python 3.12.3, x86_64, SQL 17.0.5045.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.

🟢 Approval recommended

The documentation-only changes are consistent, scoped, and contain no identified blocking issues.

0 open findings

What changed in this PR

Strengthens Perf Police guidance with evidence-led review, profiling, and handoff practices.

Changes:

  • Adds a falsifiable, baseline-driven performance review workflow.
  • Expands profiling provenance, workload, Release-build, and statistical guidance.
  • Clarifies the Perf Police agent’s review-only role and implementation handoff.
File Description
.github/​skills/​performance-code-review/​SKILL.md Expands performance review and evidence requirements.
.github/​skills/​mssql-profiler/​SKILL.md Strengthens profiling execution and reporting guidance.
.github/​agents/​perf-police.agent.md Clarifies workflow use and coding-session handoff.

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@github-actions

github-actions Bot commented Oct 8, 2026 •

Copy link
Copy Markdown

📊 Code Coverage Report

🔥 Diff Coverage

100%


🎯 Overall Coverage

85%


📈 Total Lines Covered: 11655 out of 13617
📁 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: 65.1%
mssql_python.pybind.logger_bridge.hpp: 70.8%
mssql_python._native_fetch.py: 77.4%
mssql_python.pybind.ddbc_bindings.cpp: 80.4%
mssql_python.pybind.connection.connection_pool.cpp: 81.3%
mssql_python.pybind.row_mapping_cache.hpp: 81.5%
mssql_python.pybind.connection.connection.cpp: 82.5%
mssql_python.logging.py: 86.2%

🔗 Quick Links

⚙️ Build Summary 📋 Coverage Details

View Azure DevOps Build

Browse Full Coverage Report

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot AI balanced review requested due to automatic review settings October 8, 2026 14:33

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.

🟢 Approval recommended

The documentation-only changes are consistent, actionable, and have valid local links and anchors.

0 open findings

🧠 Review effort: Balanced


Give feedback about Copilot approvals in this survey to enter a drawing for a $150 gift card.

@jahnvi480
Jahnvi Thakkar (jahnvi480) marked this pull request as ready for review October 12, 2026 04:35
Copilot AI balanced review requested due to automatic review settings October 12, 2026 06:25

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.

🟡 Changes recommended

The documented Unix build commands still do not reliably produce the required Release binaries.

1 open finding

🧠 Review effort: Balanced

Comment on lines +98 to +102
For single-configuration CMake generators, `--config Release` alone does not
select an optimized build; inspect `CMAKE_BUILD_TYPE` and the effective compile
commands. Verify optimization, assertion, and profiling flags on every measured
arm, including archived baselines. Retain that evidence rather than accepting
or rejecting a build solely from its command label.
Copilot AI balanced review requested due to automatic review settings November 11, 2026 09:26

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.

🟢 Approval recommended

No active review issues are recorded for the documentation-only updates to the Perf Police agent and skills.

1 open issue

Review effort: Balanced

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

2 participants