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

Remove some Linq usages from Routing #47004

Merged
merged 3 commits into from
Mar 8, 2023
Merged

Conversation

eerhardt
Copy link
Member

@eerhardt eerhardt commented Mar 2, 2023

These Linq usages account for roughly 150KB of the 770KB of NativeAOT app size attributed to Routing code. The largest usages are the ones where we are using ValueTypes (like ValueType and KeyValuePair) over internal types. The size savings helps even if the app is using Linq because the generic instantiation will never be brought back into the app.

On Windows x64, the BasicMinimalApi using EnableRequestDelegateGenerator=true, the app size goes from:

main: 9.70 MB (10,179,584 bytes)
PR: 9.56 MB (10,024,960 bytes)

These Linq usages account for roughly 150KB of the 770KB
of NativeAOT app size attributed to Routing code. The largest
usages are the ones where we are using ValueTypes (like ValueType and
KeyValuePair) over internal types. The size savings helps even if the
app is using Linq because the generic instantiation will never be
brought back into the app.
@eerhardt eerhardt requested review from halter73 and JamesNK March 2, 2023 17:50
@eerhardt eerhardt requested a review from javiercn as a code owner March 2, 2023 17:50
@ghost ghost added the area-runtime label Mar 2, 2023
@eerhardt
Copy link
Member Author

eerhardt commented Mar 8, 2023

I've responded to all feedback. PTAL

@eerhardt eerhardt merged commit bb41532 into dotnet:main Mar 8, 2023
@eerhardt eerhardt deleted the RemoveLinq branch March 8, 2023 15:05
@ghost ghost added this to the 8.0-preview3 milestone Mar 8, 2023
@amcasey amcasey added area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions and removed area-runtime labels Aug 25, 2023
@eerhardt eerhardt added the Perf label Oct 5, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area-networking Includes servers, yarp, json patch, bedrock, websockets, http client factory, and http abstractions Perf
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants