-
Notifications
You must be signed in to change notification settings - Fork 5.2k
Generate SslConnectionInfo.Unix.cs with T4 template #84690
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
Conversation
|
Tagging subscribers to this area: @dotnet/ncl, @bartonjs, @vcsjones Issue DetailsInstead of generating a huge static dictionary and runtime lookup, we can directly generate a switch-case chain.
This PR removes the cctor and inlines the value assignment. It shaves off 18.3 K from the final NativeAOT published binary. # on osx-arm64
# prereqs
## $ dotnet tool install -g dotnet-t4 -a arm64
## $ cd runtime
## $ t4 src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.tt -o src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs
# build required subsets to publish CG2 with map file
$ ./build.sh clr+libs+packs -c Release -p:IlcGenerateMapFile=true
# top 50 largest methods
$ xmlstarlet sel -t -m "//ObjectNodes/MethodCode" -v 'concat(@Length, ": ", @Name)' -n artifacts/obj/coreclr/crossgen2/arm64/Release/native/crossgen2.map.xml | sort -nr | head -50
|
|
Tagging subscribers to 'size-reduction': @eerhardt, @SamMonoRT, @marek-safar Issue DetailsInstead of generating a huge static dictionary and runtime lookup, we can directly generate a switch-case chain.
This PR removes the cctor and inlines the value assignment. It shaves off 18.3 K from the final NativeAOT published binary. # on osx-arm64
# prereqs
## $ dotnet tool install -g dotnet-t4 -a arm64
## $ cd runtime
## $ t4 src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.tt -o src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs
# build required subsets to publish CG2 with map file
$ ./build.sh clr+libs+packs -c Release -p:IlcGenerateMapFile=true
# top 50 largest methods
$ xmlstarlet sel -t -m "//ObjectNodes/MethodCode" -v 'concat(@Length, ": ", @Name)' -n artifacts/obj/coreclr/crossgen2/arm64/Release/native/crossgen2.map.xml | sort -nr | head -50
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM from System.Net.Security perspective.
Does it improve the size of regular System.Net.Security.dll binary as well?
Would prefer to have jkotas to have a look on this PR before merging.
src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Security/src/System/Net/Security/TlsCipherSuiteNameParser.ttinclude
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs
Outdated
Show resolved
Hide resolved
|
cc @ivanpovazan |
src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.tt
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.tt
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.cs
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.tt
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.tt
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.tt
Show resolved
Hide resolved
src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.tt
Outdated
Show resolved
Hide resolved
src/libraries/System.Net.Security/src/System/Net/Security/SslConnectionInfo.Unix.tt
Outdated
Show resolved
Hide resolved
|
Looks great otherwise - thank you! |
|
enterprise-linux failure is #84795 |
Instead of generating a huge static dictionary and runtime lookup, we can directly generate a switch-case chain.
System_Net_Security_System_Net_Security_TlsCipherSuiteData___cctoris the largest method in terms of code size.This PR removes the cctor and inlines the value assignment. It shaves off 18.3 K from the final NativeAOT published binary.