Content-Length: 315063 | pFad | https://github.com/dotnet/runtime/pull/83369

6C Do not generate Equals/GetHashCode support for async state machines by MichalStrehovsky · Pull Request #83369 · dotnet/runtime · GitHub
Skip to content

Do not generate Equals/GetHashCode support for async state machines #83369

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Mar 14, 2023

Conversation

MichalStrehovsky
Copy link
Member

Saves 0.63% on BasicMinimalApi.

This logic controls whether we inject the __GetFieldHelper override for the type (see dotnet/corert#5436). Suggestions for better ways of detecting async state machines are welcome!

Context: #83323

Cc @dotnet/ilc-contrib

Saves 0.63% on BasicMinimalApi.

This logic controls whether we inject the `__GetFieldHelper` override for the type (see dotnet/corert#5436).
@ghost
Copy link

ghost commented Mar 14, 2023

Tagging subscribers to this area: @agocke, @MichalStrehovsky, @jkotas
See info in area-owners.md if you want to be subscribed.

Issue Details

Saves 0.63% on BasicMinimalApi.

This logic controls whether we inject the __GetFieldHelper override for the type (see dotnet/corert#5436). Suggestions for better ways of detecting async state machines are welcome!

Context: #83323

Cc @dotnet/ilc-contrib

Author: MichalStrehovsky
Assignees: -
Labels:

area-NativeAOT-coreclr

Milestone: -

@jkotas
Copy link
Member

jkotas commented Mar 14, 2023

Are these more things that can be stripped from async state machines? I assume that we block reflection for them already.

@MichalStrehovsky
Copy link
Member Author

Are these more things that can be stripped from async state machines? I assume that we block reflection for them already.

No, they're eligible for reflection... except for CoreLib and the other System.Private libraries. We don't block private reflection anywhere else right now.

One thing we could do is try to make their MethodTable smaller. Currently we need to set several bits in optional fields and rare flags... that are not so rare because there's many of these.

The interface implementations also go to the sealed vtable. Not sure if there's big advantages to that.

@MichalStrehovsky
Copy link
Member Author

Are these more things that can be stripped from async state machines? I assume that we block reflection for them already.

No, they're eligible for reflection... except for CoreLib and the other System.Private libraries. We don't block private reflection anywhere else right now.

One thing we could do is try to make their MethodTable smaller. Currently we need to set several bits in optional fields and rare flags... that are not so rare because there's many of these.

The interface implementations also go to the sealed vtable. Not sure if there's big advantages to that.

Looked more into it.

Making these reflection blocked would save 0.04%. We'd also not get much saving from making the MethodTables smaller. There's only 250 state machines in BasicMinimalApi so saving ~20 bytes per each of these wouldn't be meaningful. These GetFieldHelper methods are often 200-300 bytes of overhead so the savings are more pronounced.

@MichalStrehovsky MichalStrehovsky merged commit 2b1c1e2 into dotnet:main Mar 14, 2023
@MichalStrehovsky MichalStrehovsky deleted the asyncopt branch March 14, 2023 08:21
@ghost ghost locked as resolved and limited conversation to collaborators Apr 13, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants








ApplySandwichStrip

pFad - (p)hone/(F)rame/(a)nonymizer/(d)eclutterfier!      Saves Data!


--- a PPN by Garber Painting Akron. With Image Size Reduction included!

Fetched URL: https://github.com/dotnet/runtime/pull/83369

Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy