Skip to content

Optimize bulk reader setup and harden SQL performance comparisons#213

Open
PrzemyslawKlys wants to merge 6 commits into
masterfrom
codex/performance-release-readiness
Open

Optimize bulk reader setup and harden SQL performance comparisons#213
PrzemyslawKlys wants to merge 6 commits into
masterfrom
codex/performance-release-readiness

Conversation

@PrzemyslawKlys

@PrzemyslawKlys PrzemyslawKlys commented Jul 15, 2026

Copy link
Copy Markdown
Member

Summary

  • snapshot IDataReader schema and column metadata once, then reuse it for validation, destination creation, and bulk-copy mappings
  • fail explicitly requested dbatools, bcp, FastBCP, and partitioned-reader lanes when their tools are unavailable
  • label DataTable and PowerShell-stream CSV paths honestly and default the export comparison to the direct reader
  • stabilize allocation-heavy read comparisons with five warmups and twenty measurements
  • require DbaClientX to remain fastest or within the five-percent practical tie tolerance in each comparable lane
  • preserve a single requested Office round-trip engine as a one-item array, keeping comparison selection and plan generation correct
  • make packaged assembly-path assertions cross-platform

Performance

For 100,000-row SQL-to-CSV export, the direct DbaClientX reader completes in about 60 ms versus dbatools at 87 ms and bcp at 142 ms. At 25,000 rows, DbaClientX leads dbatools by 1.33x for DataTable reads, 2.03x for PowerShell-object reads, and 1.51x to 5.70x across equivalent write shapes.

Validation

Windows and WSL .NET/Pester suites, live SQL correctness checks, typed Office round trips, package creation, packaged assembly-load isolation, and source-binary provenance pass. The SQL data-movement, direct CSV-export, and Office round-trip specs produce non-empty plans through the source-built PowerForge gate surface; the single-engine Office plan also passes under PowerShell 7 and Windows PowerShell 5.1.

Dependency order

The fastest-baseline assertion first ships in PSPublishModule 3.0.64 through EvotecIT/PSPublishModule#551. Until that release exists, use the source-built module for development; merge and release the shared PowerForge change before treating the updated benchmark specs as independently consumable. No package publication is part of this PR.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 475797a864

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Module/Examples/Benchmark.OfficeFileRoundTrip.ps1
@codecov

codecov Bot commented Jul 15, 2026

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 86.36364% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 52.79%. Comparing base (b1efa1b) to head (c5faed5).

Files with missing lines Patch % Lines
DbaClientX.SqlServer/SqlServer.BulkDataReader.cs 90.00% 1 Missing and 1 partial ⚠️
DbaClientX.SqlServer/SqlServer.BulkAutoCreate.cs 50.00% 1 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #213      +/-   ##
==========================================
+ Coverage   52.78%   52.79%   +0.01%     
==========================================
  Files         208      208              
  Lines       16097    16094       -3     
  Branches     2846     2847       +1     
==========================================
+ Hits         8496     8497       +1     
+ Misses       6758     6755       -3     
+ Partials      843      842       -1     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@PrzemyslawKlys

Copy link
Copy Markdown
Member Author

@codex please review

@chatgpt-codex-connector

Copy link
Copy Markdown

Codex Review: Didn't find any major issues. Can't wait for the next one!

Reviewed commit: 2f82364738

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

@PrzemyslawKlys

Copy link
Copy Markdown
Member Author

@codex review current head 43cddba. The only change since the prior clean review enables the shared fastest-or-within-5%-tie gate on the existing SQL and Office benchmark suites.

@chatgpt-codex-connector chatgpt-codex-connector Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💡 Codex Review

Here are some automated review suggestions for this pull request.

Reviewed commit: 43cddbad45

ℹ️ About Codex in GitHub

Your team has set up Codex to review pull requests in this repo. Reviews are triggered when you

  • Open a pull request for review
  • Mark a draft as ready
  • Comment "@codex review".

If Codex has suggestions, it will comment; otherwise it will react with 👍.

Codex can also answer questions or update the PR. Try commenting "@codex address that feedback".

Comment thread Module/Examples/Benchmark.SqlServerCsvExport.ps1
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant