Skip to content

Reduce the size of the Developer Exception Page in NativeAOT #46969

Open
@eerhardt

Description

@eerhardt

In investigating size of NativeAOT apps, one area of additional size is app.UseDeveloperExceptionPage().

When comparing the win-x64 sizes before and after adding the app.UseDeveloperExceptionPage() line, I see the following sizes:

8.99 MB (9,428,480 bytes) - AddRoutingCore()+app.UseRouting()+UseEndpoints+MapGet
9.56 MB (10,031,616 bytes) - AddRoutingCore()+app.UseRouting()+UseEndpoints+MapGet+app.UseDeveloperExceptionPage()

This means adding app.UseDeveloperExceptionPage() adds about 550 KB of app size.

We should investigate if there is a way to make this feature smaller. One way to make it smaller is #46915. There may be other optimization we could make to reduce app size. For example, maybe eliminating System.Linq usages. Another option is removing UseDeveloperExceptionPage() from CreateSlimBuilder and make it optional for the app to add it (possibly putting it into the dotnet new api template).

cc @DamianEdwards @halter73 @amcasey @captainsafia

Metadata

Metadata

Assignees

No one assigned

    Labels

    area-middlewareIncludes: URL rewrite, redirect, response cache/compression, session, and other general middlewaresfeature-diagnosticsDiagnostic middleware and pages (except EF diagnostics)investigate

    Type

    No type

    Projects

    No projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions