-
Notifications
You must be signed in to change notification settings - Fork 5.3k
Description
Description
I've tried out .NET 8 Preview 1 for my NAOT sample for ComputeSharp (https://github.com/Sergio0694/ComputeSharp), and noticed that the size delta between reflection free and now is particularly large, more than expected (talking with @MichalStrehovsky he mentioned he would've expected the different to be 3-400 KB).
Note: I am already enabling all size saving options on top of reflection free, to make the comparison fair (source):
<PropertyGroup Condition="'$(COMPUTESHARP_SWAPCHAIN_CLI_PUBLISH_AOT)' == 'true'">
<PublishAot>true</PublishAot>
<UseSystemResourceKeys>true</UseSystemResourceKeys>
<InvariantGlobalization>true</InvariantGlobalization>
<IlcGenerateStackTraceData>false</IlcGenerateStackTraceData>
<IlcDisableReflection>true</IlcDisableReflection>
<IlcOptimizationPreference>Speed</IlcOptimizationPreference>
</PropertyGroup>IlcOptimizationPreference is set to Speed since the delta for that one is just ~50 KB, so not worth it in this scenario.
Reproduction Steps
- Clone ComputeSharp (https://github.com/Sergio0694/ComputeSharp)
- For everyone to use the same reference point, let's say we checkout at 940f90df9b683b10a599300c498b38f1a72362a0)
- Open
/samples/ComputeSharp.Sample.Cli/ComputeSharp.Sample.Cli.csproj, change TFM tonet8.0 - Build the CLI sample from powershell:
$env:COMPUTESHARP_SWAPCHAIN_CLI_PUBLISH_AOT='true';
dotnet publish samples\ComputeSharp.SwapChain.Cli\ComputeSharp.SwapChain.Cli.csproj -r win-x64Expected behavior
The delta between reflection enabled and reflection free should be around smaller.
Actual behavior
I get these results:
- Reflection free: 1.892 KB
- Reflection enabled: 2.821 KB
That's a 929 KB difference (+49.1%).
Other information
Here's the two .map.xml files for both configurations: computesharp.cli.reflection.map.zip.
Metadata
Metadata
Assignees
Type
Projects
Status