KEMBAR78
Do async state machines ever have Equals/GetHashCode called? · Issue #83323 · dotnet/runtime · GitHub
Skip to content

Do async state machines ever have Equals/GetHashCode called? #83323

@MichalStrehovsky

Description

@MichalStrehovsky

NativeAOT compiler generates extra bookkeeping to support calling Equals/GetHashCode on structs. We generate it for async state machines, because they're structs. Do we have to?

A quick hack to not generate it produces 0.6% size savings for BasicMinimalApi. But not sure if it's a correct optimization. We don't have a good way to figure out the wrong thing happened at runtime (we're likely going to take "are the bytes the same" and "hash of the bytes" code paths).

Cc @stephentoub @eerhardt

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-NativeAOT-coreclrquestionAnswer questions and provide assistance, not an issue with source code or documentation.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions