Repository navigation
[Performance] Cache DynamicInvoke method metadata - #576
Merged
Merged
Conversation
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
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.
Relates to #569; this change does not close the issue. The broader accessor first-use cost remains unresolved.
Change
Cache
Delegate.DynamicInvoke(object[])as aMethodInfoand use theMethodInfooverload ofExpression.Callin both getter and setter fallbacks. This preserves current fallback behavior while avoiding the string-based expression overload's trim-analysisIL2026failure.Evidence
A trimmed .NET 10 smoke publish failed on the baseline with
IL2026and succeeded after this change; the smoke app ran successfully. ExistingIL2070/IL2075warnings remain unchanged. ShortRun BenchmarkDotNet expression-construction measurements showed no conclusive timing improvement, but allocations decreased by about 8–10% for getter and setter construction on both .NET 10 and .NET 11. The timing intervals were wide; this is not a claim of faster warm accessor calls.Validation
dotnet test ReactiveProperty.slnx -c Release --no-restore -m:1passed.dotnet build ReactiveProperty.slnx -c Release --no-restore -m:1passed; two unrelated existingCS0067warnings remain.IL2026treated as an error.Change confidence: High
Diagnosis confidence: High
Evidence fit: High