KEMBAR78
Size regression in Minimal API NativeAOT app · Issue #82732 · dotnet/runtime · GitHub
Skip to content

Size regression in Minimal API NativeAOT app #82732

@eerhardt

Description

@eerhardt

Description

Between builds 8.0.0-preview.2.23123.4+ff7c19f and 8.0.0-preview.2.23123.5+5ba867f there was a ~140KB size regression on linux-x64 Minimal API NativeAOT app.

Configuration

  • Which version of .NET is the code running on? .NET 8
  • What OS version, and what distro if applicable? Linux
  • What is the architecture (x64, x86, ARM, ARM64)? x64

Regression?

Yes. From a previous build.

Data

image

image

Here are the crank commands to repro:

crank --config https://raw.githubusercontent.com/aspnet/Benchmarks/main/scenarios/goldilocks.benchmarks.yml --config https://raw.githubusercontent.com/aspnet/Benchmarks/main/build/ci.profile.yml --scenario basicminimalapipublishaot --profile intel-load2-app --profile amd-lin2-load --profile amd-lin2-db --application.packageReferences Microsoft.Dotnet.ILCompiler=8.0.0-preview.2.23123.4 --application.framework net8.0 --application.options.collectCounters true --application.aspNetCoreVersion 8.0.0-preview.2.23123.5 --application.runtimeVersion 8.0.0-preview.2.23123.4 --application.sdkVersion 8.0.100-preview.2.23124.1

and

crank --config https://raw.githubusercontent.com/aspnet/Benchmarks/main/scenarios/goldilocks.benchmarks.yml --config https://raw.githubusercontent.com/aspnet/Benchmarks/main/build/ci.profile.yml --scenario basicminimalapipublishaot --profile intel-load2-app --profile amd-lin2-load --profile amd-lin2-db --application.packageReferences Microsoft.Dotnet.ILCompiler=8.0.0-preview.2.23123.5 --application.framework net8.0 --application.options.collectCounters true --application.aspNetCoreVersion 8.0.0-preview.2.23123.5 --application.runtimeVersion 8.0.0-preview.2.23123.5 --application.sdkVersion 8.0.100-preview.2.23124.1

Analysis

By diffing the mstat files between these two builds, it appears the majority of the size regression comes from the System namespace.

image

And drilling into the System namespace, I see a bunch of SZGenericArrayEnumerator`1 types that weren't there before, but are now.

image

And inspecting the diff between the two builds: ff7c19f...5ba867f, this leads me to believe the regression was caused by #82499. (cc @stephentoub)

I've zipped the before and after mstat files, along with a text dump in BasicMinimalApi.zip, if anyone wants to take a look.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions