Skip to content
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

Consider replacing AddRouting with AddRoutingCore in AddConnections #56559

Closed
eerhardt opened this issue Jul 1, 2024 · 0 comments · Fixed by #56703
Closed

Consider replacing AddRouting with AddRoutingCore in AddConnections #56559

eerhardt opened this issue Jul 1, 2024 · 0 comments · Fixed by #56703
Labels
area-signalr Includes: SignalR clients and servers NativeAOT Perf

Comments

@eerhardt
Copy link
Member

eerhardt commented Jul 1, 2024

In #56460 (comment) we are making SignalR server compatible with native AOT. Investigating the extra 2.2 MB of app size in a SignalR app over the dotnet new webapiaot template, the largest difference that can be trimmed is from cutting System.Text.RegularExpressions out of the app. The reason it gets pulled in is because this calls AddRouting and not AddRoutingCore.

public static IServiceCollection AddConnections(this IServiceCollection services)
{
services.AddRouting();

In the past investigations, Regex adds roughly 750 KB of app size in native AOT (see #46142 and #46227). We added AddRoutingCore for this specific reason.

cc @BrennanConroy

@dotnet-issue-labeler dotnet-issue-labeler bot added the area-signalr Includes: SignalR clients and servers label Jul 1, 2024
@eerhardt eerhardt added area-perf Performance infrastructure issues Perf area-signalr Includes: SignalR clients and servers and removed area-signalr Includes: SignalR clients and servers area-perf Performance infrastructure issues labels Jul 1, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-signalr Includes: SignalR clients and servers NativeAOT Perf
Projects
None yet
Development

Successfully merging a pull request may close this issue.

1 participant