Skip to content

Problem with runtime async in .NET 11 RC1: unexpectedly larger binary size #133954

Closed

Description

@HotCakeX

Description

I have a small program that uses .NET 11 RC1 which is controlled here and here

Normally, the binary size is 1.55 MB, but after adding this line

<Features>$(Features);runtime-async=on</Features>

The binary size is 2.12 MB

Image
Image

Reproduction Steps

  1. Publish the program for X64 architecture
  2. Observe the binary size with and without runtime async feature.

Expected behavior

Binary size either remain the same, or slightly vary.

Actual behavior

Binary size increased unexpectedly, rooting many new things.

Regression?

No response

Known Workarounds

No response

Configuration

No response

Other information

Visual Studio 2026 Insider
Windows 11 25H2

Activity

  1. added
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    on Sep 15, 2026
  2. dotnet-policy-service commented on Sep 15, 2026

    @dotnet-policy-service
    Contributor

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

  3. tannergooding commented on Sep 15, 2026

    @tannergooding
    Member

    There was some more discussion on Discord and notably it looked like various things like TimeZoneInfo were being indirectly rooted

    Paths like Main->NamedPipeServerStream->SR.get_InvalidOperation_PipeAlreadyConnected->ResourceManager->ResourceReader.LoadObjectV2->DateTime.FromBinary->TimeZoneInfo.cctor for example

    It might be more general cases of the static constructor trimming that got done for #132576 and which is included for RC2 (but not RC1)

  4. removed
    area-CodeGen-coreclrCLR JIT compiler in src/coreclr/src/jit and related components such as SuperPMI
    untriagedNew issue has not been triaged by the area owner
    on Sep 15, 2026
  5. dotnet-policy-service commented on Sep 15, 2026

    @dotnet-policy-service
    Contributor

    Tagging subscribers to this area: @agocke, @dotnet/ilc-contrib
    See info in area-owners.md if you want to be subscribed.

  6. tannergooding commented on Sep 15, 2026

    @tannergooding
    Member

    with a different standalone sample, I see the regression too
    notably RC2 is smaller than RC1, but the gap between runtime-async=off vs on is even larger (bigger regression)

    looks to generally be because the substituted IL only works with EcmaMethodIL and so it fails to fold the resource accesses because NativeAotILProvider.AsyncMethodIL fails that check

    so we basically get this and it stays rooted due to not folding

    Main <AsyncCallable>
      -> WaitForConnectionCoreAsync <AsyncCallable>
      -> SR.get_InvalidOperation_PipeAlreadyConnected
      -> ResourceManager / ResourceReader._LoadObjectV2
      -> DateTime.FromBinary
      -> TimeZoneInfo.Local / .cctor
    
  7. locked and limited conversation to collaborators on Oct 17, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    • Status
      No status

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions