Cache plain generation results in the incremental pipeline - #40
Merged
Conversation
- Run MapperCompiler inside the ForAttributeWithMetadataName transform and cache only emitted source and diagnostic data, so cached mappers keep no compilation or symbols alive and every contract edit is observed - Split MapperCompiler into partial-class files by responsibility - Match mapping attributes by symbol, stamp generated members with the assembly version, and plan deferred construction structurally - Align versions: add the 1.2.1 changelog entry, pin README to 1.2.1, raise the package validation baseline, and derive CI and script versions from Directory.Build.props - Add incremental, pipeline-value, snapshot and repository-consistency tests
There was a problem hiding this comment.
⚠️ Performance Alert ⚠️
Possible performance regression was detected for benchmark 'ComparisonMappingBenchmarks'.
Benchmark result of this commit is worse than the previous benchmark result exceeding threshold 1.25.
| Benchmark suite | Current: 280d0f5 | Previous: 187ef20 | Ratio |
|---|---|---|---|
DomainMapper.Benchmarks.ComparisonMappingBenchmarks.DomainMapperFlat |
11.87693651765585 ns (± 0.3271875392584718) |
7.598527964949608 ns (± 0.11638510408811246) |
1.56 |
DomainMapper.Benchmarks.ComparisonMappingBenchmarks.DomainMapperRenamedFlattened |
9.483548912812363 ns (± 0.28219199013618357) |
7.177408418485096 ns (± 0.07761475547820171) |
1.32 |
DomainMapper.Benchmarks.ComparisonMappingBenchmarks.DomainMapperValueObjectFactory |
6.90919190744559 ns (± 0.16355923549592302) |
4.894221918547855 ns (± 0.15484899538459032) |
1.41 |
DomainMapper.Benchmarks.ComparisonMappingBenchmarks.MapperlyValueObjectFactory |
7.574208869536718 ns (± 0.09981800287601893) |
5.710719750435264 ns (± 0.2272405772790416) |
1.33 |
This comment was automatically generated by workflow using github-action-benchmark.
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.
Description
Authored with Claude Code from a code review of the repository; every finding below was verified locally before being fixed.
Incremental pipeline. The cached pipeline value previously held the mapper
INamedTypeSymboland theCompilation, compared only by a content fingerprint. Because the driver keeps the previous value when the comparer reports equality, each cached mapper retained the compilation it was last generated from, and the fingerprint could miss dependencies (a member on an inherited interface of the source was not observed). The transform now runsMapperCompilerand yields a plainMapperGenerationResult(hint name, source text,DiagnosticData), so the driver compares emitted output and re-adds only mappers whose output changed. A reflection test proves the cached value references no compilation, symbol, tree, location or diagnostic.Incremental benchmark (short job, 64 mappers): NoOpCore unchanged at 13.9 µs; IsolatedContractEdit 290 µs → 659 µs because every mapper now regenerates inside the transform; SharedContractEdit 2296 µs → 1878 µs because the fingerprint walk is gone.
Engine.
MapperCompileris split into partial-class files by responsibility. Attributes are matched by symbol throughGetTypesByMetadataNameinstead of display-string comparison. Deferred construction is planned throughCreationPlaninstead of a base64 text marker. Generated members are stamped with the generator assembly version instead of a fixed0.0.1.0.Versions and CI. Adds the missing 1.2.1 changelog entry, pins the README to 1.2.1, raises
PackageValidationBaselineVersionto 1.2.1, and derives the development version intest.yml,package.sh,docs.ymland the Docusaurus config fromDirectory.Build.props. Removes the rule 52 exclusion from package validation now that the repository is public, and drops dead configuration and unused test packages.Tests. 140 tests (from 120): incremental regeneration for inherited interface members, output-neutral edits reporting
Unchanged, pipeline value purity, rehydrated diagnostic locations, assembly version stamp, symbol attribute matching, creation ordering, five Verify full-file snapshots, and repository consistency guards for versions.Fixes # (issue)
Checklist
🤖 Generated with Claude Code