Registry Mirror
Skip to content

Conversation

@BrzVlad

@BrzVlad BrzVlad commented Feb 18, 2026

Copy link
Copy Markdown
Member

These methods were likely skipped on r2r so they can end up with better generated code at runtime, from the JIT. On iOS, this would have the exact opposite effect. By not using r2r for them, the methods would be interpreted with terrible perf.

These methods were likely skipped on r2r so they can end up with better generated code at runtime, from the JIT. On iOS, this would have the exact opposite effect. By not using r2r for them, the methods would be interpreted with terrible perf.
@BrzVlad

BrzVlad commented Feb 18, 2026

Copy link
Copy Markdown
Member Author

Given we've moved away from this attribute, in our libraries code, I'm wondering whether we might want to not special case along it at all.

Copilot AI left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes an iOS-specific performance issue by ensuring that methods marked with AggressiveOptimization are included in ReadyToRun compilation when JIT is unavailable. Previously, these methods were unconditionally skipped in R2R, which meant they would be interpreted on iOS (where JIT is disabled) resulting in poor performance.

Changes:

  • Modified the R2R compiler to skip methods with AggressiveOptimization only on platforms that allow runtime code generation (JIT)
  • Extracted TargetAllowsRuntimeCodeGeneration to a local variable for code reuse and efficiency

@EgorBo

EgorBo commented Feb 18, 2026

Copy link
Copy Markdown
Member

Given we've moved away from this attribute, in our libraries code, I'm wondering whether we might want to not special case along it at all.

I think it's fine to have it - it may help those, who disable Tiered Compilation and need an escape hatch for certain methods to be compiled with JIT as it generally produces a better codegen, otherwise all R2R'd methods will always stuck in R2R.

@BrzVlad
BrzVlad merged commit c8f006d into dotnet:main Feb 20, 2026
110 of 112 checks passed
iremyux pushed a commit to iremyux/dotnet-runtime that referenced this pull request Mar 2, 2026
…dotnet#124549)

These methods were likely skipped on r2r so they can end up with better
generated code at runtime, from the JIT. On iOS, this would have the
exact opposite effect. By not using r2r for them, the methods would be
interpreted with terrible perf.
@github-actions github-actions Bot locked and limited conversation to collaborators Mar 22, 2026
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants