Uh oh!
There was an error while loading. Please reload this page.
Generate SslConnectionInfo.Unix.cs with T4 template - #84690
Conversation
ghost
commented
Apr 12, 2023
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
|
ghost
commented
Apr 12, 2023
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
|
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
SamMonoRT
commented
Apr 14, 2023
cc @ivanpovazan |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Looks great otherwise - thank you! |
jkotas
commented
Apr 17, 2023
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.