Skip to content

Use Reflection.Emit accessors when dynamic code is supported - #487

Merged
eiriktsarpalis merged 1 commit into
mainfrom
eiriktsarpalis-align-reflection-accessors
Jul 28, 2026
Merged

Use Reflection.Emit accessors when dynamic code is supported#487
eiriktsarpalis merged 1 commit into
mainfrom
eiriktsarpalis-align-reflection-accessors

Conversation

@eiriktsarpalis

Copy link
Copy Markdown
Owner

Restores Reflection.Emit member accessors as the default whenever dynamic code is supported, mirroring dotnet/runtime#131452. This reverts the accessor-selection portion of #473 while retaining its reflection invocation and exception-propagation changes.

The IsDynamicCodeCompiled gate assumed emitted IL offered no throughput benefit under interpreters. The measurements behind dotnet/runtime#131452 show that interpreted DynamicMethod accessors substantially outperform repeated reflection invocation, so the default now uses IsDynamicCodeSupported and the unused compatibility helper is removed.

Validation: make test

Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Copilot-Session: 0bba94e9-a444-4146-957b-dcc6fb2d9b56
@eiriktsarpalis
eiriktsarpalis merged commit 80baf39 into main Jul 28, 2026
7 checks passed
@eiriktsarpalis
eiriktsarpalis deleted the eiriktsarpalis-align-reflection-accessors branch July 28, 2026 12:11
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.

1 participant