Skip to content

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

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

Open
eerhardt opened this issue Mar 2, 2023 · 3 comments
Open

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

eerhardt opened this issue Mar 2, 2023 · 3 comments
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares feature-diagnostics Diagnostic middleware and pages (except EF diagnostics) investigate
Milestone

Comments

@eerhardt
Copy link
Member

eerhardt commented Mar 2, 2023

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

@Tratcher Tratcher added area-runtime feature-diagnostics Diagnostic middleware and pages (except EF diagnostics) labels Mar 2, 2023
@brunolins16
Copy link
Member

Maybe this is helping to the size increase #46339

@DamianEdwards
Copy link
Member

@brunolins16 yeah good point.

@eerhardt I think we need to strive to keep the developer exception page in the experience one way or another, whether it's by reducing its size, removing it from slim builder and adding it to the template, or whatever we end up doing for #46096. Seems prudent to first start with trying to reduce the size via the identified leads.

@ghost
Copy link

ghost commented May 1, 2023

To learn more about what this message means, what to expect next, and how this issue will be handled you can read our Triage Process document.
We're moving this issue to the .NET 8 Planning milestone for future evaluation / consideration. Because it's not immediately obvious what is causing this behavior, we would like to keep this around to collect more feedback, which can later help us determine how to handle this. We will re-evaluate this issue, during our next planning meeting(s).
If we later determine, that the issue has no community involvement, or it's very rare and low-impact issue, we will close it - so that the team can focus on more important and high impact work.

@amcasey amcasey added area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares and removed area-runtime labels Jun 2, 2023
@mitchdenny mitchdenny removed their assignment Jul 3, 2023
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@dotnet-policy-service dotnet-policy-service bot added the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 6, 2024
@wtgodbe wtgodbe removed the pending-ci-rerun When assigned to a PR indicates that the CI checks should be rerun label Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
@dotnet dotnet deleted a comment from dotnet-policy-service bot Feb 13, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-middleware Includes: URL rewrite, redirect, response cache/compression, session, and other general middlewares feature-diagnostics Diagnostic middleware and pages (except EF diagnostics) investigate
Projects
None yet
Development

No branches or pull requests

9 participants