Benchmark interceptor gains against historical baseline - #825
Merged
Conversation
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Copilot created this pull request from a session on behalf of
AndreaCuneo
August 3, 2026 06:15
View session
AndreaCuneo
marked this pull request as ready for review
August 3, 2026 06:15
Contributor
There was a problem hiding this comment.
Pull request overview
Adds end-to-end runtime + benchmark coverage to quantify and validate ToDataTableArk<T>() interceptor performance against the historical reflection implementation, while also wiring the interceptor namespace automatically for both NuGet consumers and monorepo projects.
Changes:
- Adds a standalone benchmark harness comparing historical baseline vs optimized fallback vs interceptor vs
Rows.Addinsertion. - Adds comprehensive regression tests for reflection fallback behavior and interceptor runtime interception/deduplication.
- Ensures the interceptor namespace is allow-listed via
buildTransitiveassets and via repo-wideDirectory.Build.props.
Reviewed changes
Copilot reviewed 22 out of 23 changed files in this pull request and generated 3 comments.
Show a summary per file
| File | Description |
|---|---|
| tests/Ark.Tools.Core.Tests/DataTableExtensionsTests.cs | Adds broad reflection-fallback regression coverage (schema, conversions, row state, failure behavior). |
| tests/Ark.Tools.Core.Interceptors.Tests/packages.lock.json | Locks dependencies for the new interceptor runtime test project. |
| tests/Ark.Tools.Core.Interceptors.Tests/InterceptorRuntimeTests.cs | Verifies interception occurs and inspects emitted generated source for expected patterns. |
| tests/Ark.Tools.Core.Interceptors.Tests/InterceptedEntity.cs | Test fixtures used to validate eligible/ineligible interception scenarios. |
| tests/Ark.Tools.Core.Interceptors.Tests/Generated/Ark.Tools.Core.Analyzers/Ark.Tools.Core.Analyzers.ToDataTableArkInterceptorGenerator/ToDataTableArkInterceptors.g.cs | Checked-in example of generated interceptor output. |
| tests/Ark.Tools.Core.Interceptors.Tests/Ark.Tools.Core.Interceptors.Tests.csproj | New test project that explicitly wires the analyzer and emits compiler-generated files. |
| src/common/Ark.Tools.Core/DataTableExtensions.cs | Refactors fallback shredding to use cached compiled accessors and adds try/finally around bulk-load lifecycle. |
| src/common/Ark.Tools.Core/buildTransitive/Ark.Tools.Core.props | Adds InterceptorsNamespaces opt-in for NuGet consumers via transitive build assets. |
| src/common/Ark.Tools.Core/Ark.Tools.Core.csproj | Packs the new buildTransitive props into the NuGet package. |
| src/common/Ark.Tools.Core.Analyzers/ToDataTableArkInterceptorModels.cs | Adds symbol-free models for incremental generator pipeline. |
| src/common/Ark.Tools.Core.Analyzers/ToDataTableArkInterceptorGenerator.cs | New C# 14 interceptor generator emitting reflection-free ToDataTableArk implementations per callsite/type. |
| Directory.Build.props | Adds repo-wide InterceptorsNamespaces allow-list for monorepo ProjectReference scenarios. |
| benchmarks/Ark.Tools.Core.Benchmarks/RowsAddConverter.cs | Adds Rows.Add-style converter for benchmark comparison. |
| benchmarks/Ark.Tools.Core.Benchmarks/results/optimized.md | Records optimized fallback benchmark results and methodology notes. |
| benchmarks/Ark.Tools.Core.Benchmarks/results/interceptor-comparison.md | Records comparison results across baseline/fallback/interceptor/Rows.Add. |
| benchmarks/Ark.Tools.Core.Benchmarks/results/baseline.md | Records historical baseline benchmark results and methodology notes. |
| benchmarks/Ark.Tools.Core.Benchmarks/Program.cs | Benchmark harness main program printing markdown tables. |
| benchmarks/Ark.Tools.Core.Benchmarks/packages.lock.json | Locks dependencies for the new benchmarks project. |
| benchmarks/Ark.Tools.Core.Benchmarks/HistoricalBaselineConverter.cs | Reproduces the pre-optimization reflection implementation for benchmarks. |
| benchmarks/Ark.Tools.Core.Benchmarks/BenchmarkRow.cs | Model representing a single benchmark measurement row. |
| benchmarks/Ark.Tools.Core.Benchmarks/BenchmarkEntity.cs | Benchmark fixture entity and deterministic data generator. |
| benchmarks/Ark.Tools.Core.Benchmarks/Ark.Tools.Core.Benchmarks.csproj | New benchmarks console project that wires the analyzer for interception. |
| Ark.Tools.slnx | Adds the new benchmarks and interceptor test projects to the solution. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
AndreaCuneo
requested changes
Aug 3, 2026
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
AndreaCuneo
approved these changes
Aug 3, 2026
Contributor
|
@copilot sync with master |
Co-authored-by: AndreaCuneo <5227688+AndreaCuneo@users.noreply.github.com>
Contributor
Author
AndreaCuneo
approved these changes
Aug 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
The existing benchmark compared the interceptor only with the already-optimized fallback. This adds the original reflection baseline and evaluates
LoadDataRowagainst MoreLINQ-styleRows.Add.Changes
Benchmark coverage
Rows.Add.Results
Rows.Addis 9–22% slower for bulk input and changes row-state semantics.Loading lifecycle
LoadDataRow.try/finallyin runtime and generated paths:Unchanged.