Repository navigation
Conversation
There was a problem hiding this comment.
Copilot review overview
🟡 Changes recommended
Timeout validation conflicts with existing semantics, and the documented regression-check script is missing.
Review effort: Balanced
Findings: 1
Open (2)
What changed in this PR
Expands performance benchmarks for command execution, typed readers, large payloads, MARS, and Always Encrypted scenarios.
Changes:
- Adds broader synchronous/asynchronous command and reader benchmarks.
- Moves fixture setup and allocations outside measured regions.
- Adds filtering, validation, and benchmark failure reporting.
Validation was source inspection only; tests were not run.
| File | Description |
|---|---|
runnerconfig.jsonc |
Adds 128 MiB payload and longer timeouts. |
README.md |
Documents coverage and execution. |
Program.cs |
Adds filtering and failure handling. |
DBFramework/Table.cs |
Adds setup timeouts and disposal. |
DBFramework/MixedRowFixture.cs |
Creates mixed-row fixtures. |
DBFramework/DbUtils.cs |
Applies command timeouts. |
Config/Loader.cs |
Disables nullable analysis. |
Config/Config.cs |
Introduces specialized job types. |
Config/CommandRunnerJob.cs |
Adds defaults and validation. |
SqlCommandRunner.cs |
Expands command API benchmarks. |
LargeDataReadRunner/Plaintext.cs |
Adds binary/text accessor coverage. |
LargeDataReadRunner/LargeDataReadRunnerBase.cs |
Centralizes large-value setup and validation. |
LargeDataReadRunner/AlwaysEncrypted.cs |
Adapts encrypted large-value benchmarks. |
DataTypeReaderRunner/ReaderCase.cs |
Models individual and mixed reader cases. |
DataTypeReaderRunner/Plaintext.cs |
Adds mixed rows and sequential access. |
DataTypeReaderRunner/DataTypeReaderRunnerBase.cs |
Adds typed and GetValues benchmarks. |
DataTypeReaderRunner/AlwaysEncrypted.cs |
Adapts encrypted reader benchmarks. |
CommandRunnerBase.cs |
Centralizes connection and command lifecycle. |
💡 Configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
Remove check for negative TimeoutMinutes in CommandRunnerJob. Co-authored-by: Copilot Autofix powered by AI <175728472+Copilot@users.noreply.github.com>
priyankatiwari08
left a comment
There was a problem hiding this comment.
Partial review - diff is large, so I focused on SqlCommandRunner, CommandRunnerBase, DataTypeReaderRunnerBase, LargeDataReadRunnerBase, MixedRowFixture and Program.cs.
- Async readers/streams lost
await usingin six places - see inline. Program.cs: the first failing unit setsExitCode = 1and returns, so later enabled units are silently skipped; alsoBenchmarkRunner.Run(type, config, args)lets command-line args override the unit's job config that was just validated.
| await using SqlCommand cmd = new($"SELECT Data FROM {_table.Name}", _connection); | ||
| await using SqlDataReader reader = await cmd.ExecuteReaderAsync(CommandBehavior); | ||
|
|
||
| using SqlDataReader reader = await ReadCommand.ExecuteReaderAsync(CommandBehavior); |
There was a problem hiding this comment.
This was await using before - plain using forces synchronous disposal of an async reader, which can block draining remaining results and skews what the async benchmark measures. Same downgrade in DataTypeReaderRunnerBase (3x), SqlCommandRunner, and the GetStream path.
There was a problem hiding this comment.
Sure, I'll just add those wherever valid.
…:dotnet/sqlclient into dev/russellben/more-sqlcommand-perftests



The existing benchmarks cover a limited set of command and reader scenarios, and some include fixture preparation or measure iterations too short for stable results. This change expands coverage within the existing runners and focuses measurements on command execution and result consumption.
Changes
Infrastructure changes retain existing runner names, discovery, and configuration entry points. BenchmarkDotNet filtering and listing now work across enabled units, and invalid configurations or failed cases produce a failing exit code.
Validation
Measurement boundaries have changed, so driver comparisons should use the same updated benchmark sources rather than historical results from the previous implementations.
🤖
Implemented and validated entirely using 🤖