Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Relevance of MethodImplOptions.AggressiveOptimization #128435

Answered by EgorBo
msedi asked this question in Q&A
Discussion options

Of what relevance is MethodImplOptions.AggressiveOptimization nowadays. When searching through the runtime dotnet repo I can only find a few occurences. Benchmarking with and without AggressiveOptimization shows that is better not to use it.

Are there any suggestions or thoughts about this?

You must be logged in to vote

It helps in extremely niche scenarios where Tier 0 (on CoreCLR) is too slow or allocates too much, and it can't be crossgen'd due to cross-assembly types - though we might eventually work around that on the runtime side. Otherwise, it's a pure regression: there is no dynamic PGO, and it's highly likely that all statics aren't initialized at JIT time, meaning they are emitted with lazy-init helper calls, etc. Obviously, it has no impact on NativeAOT at all. Sometimes it might be used as a "don't use Dynamic PGO for this" hint, but there shouldn't be a good reason for that either.

Basically, in the entire BCL there is just one usage (see #90965 and #90899)

Replies: 2 comments 1 reply

Comment options

It helps in extremely niche scenarios where Tier 0 (on CoreCLR) is too slow or allocates too much, and it can't be crossgen'd due to cross-assembly types - though we might eventually work around that on the runtime side. Otherwise, it's a pure regression: there is no dynamic PGO, and it's highly likely that all statics aren't initialized at JIT time, meaning they are emitted with lazy-init helper calls, etc. Obviously, it has no impact on NativeAOT at all. Sometimes it might be used as a "don't use Dynamic PGO for this" hint, but there shouldn't be a good reason for that either.

Basically, in the entire BCL there is just one usage (see #90965 and #90899)

You must be logged in to vote
0 replies
Answer selected by msedi
Comment options

You must be logged in to vote
1 reply
Comment options

@EgorBo @mg1986jp : Thanks a lot for your detailed explanation. That helped ;-)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet

AltStyle によって変換されたページ (->オリジナル) /