Reduce MSTest source generation startup overhead - #10545
Conversation
Remove unused DataRow and parameter-name descriptors, reuse per-class reflection enumerations, pre-size registration dictionaries, and avoid copying assembly attributes. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Emit zero-copy assembly metadata without array covariance, clarify trimming and ownership contracts, and make reflection-free acceptance coverage explicit. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com> Copilot-Session: 22842b75-382d-49db-9517-c146e91547f2
There was a problem hiding this comment.
Pull request overview
Reduces reflection-free MSTest source-generation startup overhead while preserving metadata resolution and fallback behavior.
Changes:
- Removes unused DataRow and parameter-name descriptors.
- Reuses reflected member arrays and pre-sizes registration dictionaries.
- Expands generator and packaged acceptance coverage.
Show a summary per file
| File | Description |
|---|---|
test/UnitTests/MSTest.SourceGeneration.UnitTests/MSTestReflectionMetadataGeneratorTests.cs |
Updates generated-output expectations and coverage. |
test/IntegrationTests/MSTest.Acceptance.IntegrationTests/SourceGenerationNonAotTests.cs |
Validates compact output, overloads, and runtime behavior. |
src/Analyzers/MSTest.SourceGeneration/Models/TestClassModel.cs |
Removes unused model fields. |
src/Analyzers/MSTest.SourceGeneration/Generators/TestClassModelBuilder.cs |
Stops constructing unused metadata. |
src/Analyzers/MSTest.SourceGeneration/Generators/RuntimeRegistrationEmitter.cs |
Optimizes reflection enumeration and collection allocation. |
src/Analyzers/MSTest.SourceGeneration/Generators/MetadataRegistryEmitter.cs |
Emits a smaller registry and zero-copy assembly attributes. |
src/Analyzers/MSTest.SourceGeneration/Generators/DataRowBuilder.cs |
Removes obsolete DataRow descriptor generation. |
src/Adapter/MSTestAdapter.PlatformServices/SourceGeneration/ReflectionMetadataHook.cs |
Clarifies collection ownership and immutability expectations. |
Review details
Tip
Add a code-review agent skill or configure MCP servers for context-aware, tailored reviews. Learn more in the docs.
- Files reviewed: 8/8 changed files
- Comments generated: 0
- Review effort level: Balanced
🧵 Parallel-safety audit — PR #10545Parallelization — one row per test assembly audited:
Findings: A (global-state) Top actions (by expected value): none — no unsafe call sites found in the changed test regions. DetailsThe two changed test files are:
The No Advisory only — heuristic, non-blocking. Re-run with
|
🧪 Expert test review — PR #10545
This advisory comment was generated automatically. Grades are heuristic
|
There was a problem hiding this comment.
🤖 Automated content by GitHub Copilot. Generated by the Test Reviewer on PR (on open / sync) workflow. · auto · 115.2 AIC · ⌖ 10.8 AIC · ⊞ 16.9K · ◷
Summary
DataRowsand parameter-name descriptors that runtime registration never consumesPerformance
Representative six-class test assembly, 100 warmed process starts:
Validation
No tracking issue.