-
Notifications
You must be signed in to change notification settings - Fork 4.8k
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
MAUI iOS sample app size regression compared to .NET7 #79825
Comments
Tagging subscribers to 'size-reduction': @eerhardt, @SamMonoRT, @marek-safar Issue DetailsSize regression for MAUI iOS appsMAUI sample app
when compared against dotnet/runtime Linked issuesSimilar size regressions have been reported for the Mono sample app and WASM here:
for which the following issues have been detected as the ones causing the regressions:
Repro steps
git clone https://github.com/dotnet/runtime.git <some_repo_dir>
cd <some_repo_dir>
./build.sh mono+libs -c Release -os iOS -arch arm64
cd ~/
dotnet --version
7.0.100
sudo dotnet workload install maui --source https://api.nuget.org/v3/index.json
dotnet new maui -n "MyMauiApp"
cd MyMauiApp
<Target Name="UpdateRuntimePackAndAOTCompiler"
AfterTargets="ResolveFrameworkReferences"
Condition="'$(UseCurrentMainBranch)' == 'true'" >
<Error Condition="'$(DotnetRuntimeRepo)' == ''" Text="You must specify the location of your dotnet/runtime repository via -p:DotnetRuntimeRepo=<some_repo_dir>"/>
<ItemGroup>
<!-- update runtime pack to local build -->
<ResolvedRuntimePack PackageDirectory="$(DotnetRuntimeRepo)/artifacts/bin/microsoft.netcore.app.runtime.ios-arm64/Release"
Condition="'%(ResolvedRuntimePack.FrameworkName)' == 'Microsoft.NETCore.App'" />
<!-- remove AOT compiler reference for ios-arm64 -->
<MonoAotCrossCompiler Remove="@(MonoAotCrossCompiler)"
Condition="%(RuntimeIdentifier) == 'ios-arm64'" />
<!-- update AOT compiler reference to local build -->
<MonoAotCrossCompiler Include="$(DotnetRuntimeRepo)/artifacts/bin/mono/iOS.arm64.Release/cross/ios-arm64/mono-aot-cross">
<RuntimeIdentifier>ios-arm64</RuntimeIdentifier>
</MonoAotCrossCompiler>
</ItemGroup>
</Target>
dotnet publish -c Release -f net7.0-ios -r ios-arm64 --self-contained -bl -p:_RequireCodeSigning=false
ls -al bin/Release/net7.0-ios/ios-arm64/publish/MyMauiApp.ipa
ls -al bin/Release/net7.0-ios/ios-arm64/MyMauiApp.app
in the following way: rm -rf bin obj
dotnet publish -c Release -f net7.0-ios -r ios-arm64 --self-contained -bl -p:_RequireCodeSigning=false -p:DotnetRuntimeRepo="<some_repo_dir>" -p:UseCurrentMainBranch=true
Size on disk comparison (in bytes)
ObservationBiggest differences can be seen in the app binary /cc: @SamMonoRT @kotlarmilos @rolfbjarne @jonathanpeppers @vargaz @stephentoub
|
A size increase this large might be caused by generating/not stripping debug info etc. |
Some observations:
As discussed elsewhere, adding a linker conditional to the Vector fallback methods which links them out if the platform supports SIMD would probably help a lot. |
Here is another comparison table with the data just before the enums change i.e. its parent commit: 6e0c046 and with the change included 62f3eb2. Unfortunately I have troubles building the sample app with the earlier changes regarding generics 486682a but will update the issue if I managed to get around the compilation failures, to see how much this change affected the first regression point of Size on disk comparison (in bytes)
|
some of these are mitigated by the de-dup feature and other fixes. Moving this to 9.0.0 |
@kotlarmilos once we have the updated numbers from automation, add them here. |
With the latest measurements presented in xamarin/xamarin-macios#18555 we have ~4% smaller apps compared to .NET7 release. So, I believe we could close this issue even for 8.0.0 time frame. Nevertheless, we should wait for the PR to get merged and get the presented numbers in perf measurements. |
Closing issue based on above comments. |
Size regression for MAUI iOS apps
MAUI sample app
dotnet new maui -n "MyMauiApp"
has regressed in size compared to the.NET7
release:.app
directory size regressed around78.5%
from40598192
to72477624
bytes.ipa
file size regressed around74%
from13074853
to22755931
byteswhen compared against dotnet/runtime
main
branch at: a92c5bcLinked issues
Similar size regressions have been reported for the Mono sample app and WASM here:
for which the following issues have been detected as the ones causing the regressions:
Repro steps
dotnet 7.0.100
from https://dotnet.microsoft.com/en-us/download/dotnet/7.07.0.100
is the one on the pathTarget
inMyMauiApp.csproj
file:.NET7
release:.ipa
file and.app
folder sizes:current main
from step (2) by:DotnetRuntimeRepo
with the path to your localdotnet/runtime
directory (instead of the <some_repo_dir> placeholder)UseCurrentMainBranch
with the valuetrue
in the following way:
rm -rf bin obj dotnet publish -c Release -f net7.0-ios -r ios-arm64 --self-contained -bl -p:_RequireCodeSigning=false -p:DotnetRuntimeRepo="<some_repo_dir>" -p:UseCurrentMainBranch=true
Size on disk comparison (in bytes)
Observation
Biggest differences can be seen in the app binary
MyMauiApp
(row 33) and.aotdata.arm64
files./cc: @SamMonoRT @kotlarmilos @rolfbjarne @jonathanpeppers @vargaz @stephentoub
The text was updated successfully, but these errors were encountered: