Skip to content

Remove some Linq usages from Routing - #47004

Merged
eerhardt merged 3 commits into
dotnet:mainfrom
eerhardt:RemoveLinq
Mar 8, 2023
Merged

eerhardt merged 3 commits into
dotnet:mainfrom
eerhardt:RemoveLinq

Conversation

@eerhardt

@eerhardt eerhardt commented Mar 2, 2023

Copy link
Copy Markdown
Member

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 JamesNK and halter73 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

eerhardt commented Mar 8, 2023

Copy link
Copy Markdown
Member Author

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