Skip to content

[Performance] Cache DynamicInvoke method metadata - #576

Merged
runceel merged 1 commit into
mainfrom
runceel-property-path-performance-841
Nov 27, 2026
Merged

runceel merged 1 commit into
mainfrom
runceel-property-path-performance-841

Conversation

@runceel

@runceel runceel commented Nov 27, 2026

Copy link
Copy Markdown
Owner

Relates to #569; this change does not close the issue. The broader accessor first-use cost remains unresolved.

Change

Cache Delegate.DynamicInvoke(object[]) as a MethodInfo and use the MethodInfo overload of Expression.Call in both getter and setter fallbacks. This preserves current fallback behavior while avoiding the string-based expression overload's trim-analysis IL2026 failure.

Evidence

A trimmed .NET 10 smoke publish failed on the baseline with IL2026 and succeeded after this change; the smoke app ran successfully. Existing IL2070/IL2075 warnings 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:1 passed.
  • dotnet build ReactiveProperty.slnx -c Release --no-restore -m:1 passed; two unrelated existing CS0067 warnings remain.
  • Trimmed .NET 10 smoke publish/run passed with IL2026 treated as an error.

Change confidence: High
Diagnosis confidence: High
Evidence fit: High

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
@runceel
runceel merged commit 1c30f9e into main Nov 27, 2026
5 checks passed
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.

2 participants