Closed mlancione closed 2 days ago
There are two main possibilities to decrease build time:
TrimMode=partial
in the project file)UseInterpreter=true
in the project file).I see the interpreter is not an option for you, but I'm surprised setting TrimMode=partial doesn't change anything. Can you get an MSBuild binlog with that property set?
I retried TrimMode=partial and it indeed worked. The build time for the template iOS project is now 11s. Should TrimMode=copy or MtouchLink=None also speed up build time since they're supposed to bypass all trimming? Those options seem to still cause the build to take 70+ seconds.
Building my main Application project is still taking 70+ seconds with the TrimMode=partial setting.
Can I email you a binlog directly for this project to see why the TrimMode=partial setting seems to be ignored? I would rather not post it here.
Should TrimMode=copy or MtouchLink=None also speed up build time since they're supposed to bypass all trimming? Those options seem to still cause the build to take 70+ seconds.
No, that won't speed up the build, because while it won't spend any time trimming, it'll spend a lot of time AOT-compiling all the assemblies (because they weren't trimmed, there's a lot of code to AOT-compile).
Can I email you a binlog directly for this project to see why the TrimMode=partial setting seems to be ignored? I would rather not post it here.
Yes, of course: Rolf.Kvinge@microsoft.com
Should TrimMode=copy or MtouchLink=None also speed up build time since they're supposed to bypass all trimming? Those options seem to still cause the build to take 70+ seconds.
No, that won't speed up the build, because while it won't spend any time trimming, it'll spend a lot of time AOT-compiling all the assemblies (because they weren't trimmed, there's a lot of code to AOT-compile).
Thanks for the explanation. Is there a way to bypass both the trimming and the AOT compile (for iOS simulator builds) while keeping UseInterpreter set to false?
Can I email you a binlog directly for this project to see why the TrimMode=partial setting seems to be ignored? I would rather not post it here.
Yes, of course: Rolf.Kvinge@microsoft.com
Thanks. The binlog has been sent.
Can I email you a binlog directly for this project to see why the TrimMode=partial setting seems to be ignored? I would rather not post it here.
Yes, of course: Rolf.Kvinge@microsoft.com
Thanks. The binlog has been sent.
The TrimMode=partial
option is working, it's just that your project is so much bigger than a new project from a template that the AOT compiler takes so much longer to compile everything.
Using TrimMode=full
might help somewhat, but the real improvement is probably going to come from using the interpreter instead, once the debugger issue is fixed (thanks for the test case!)
Closing as a duplicate of #21444, where we'll deal with improving build times for arm64 simulators.
Apple platform
iOS
Framework version
net9.0-*
Affected platform version
Terminal or VS Code on MacOS 14.7
Description
Building the template net9.0-ios project via "dotnet new ios" for the iOS Simulator takes 74.6s to build (on an M2 MacBook). It spends over 60s in the _AOTCompile step.
Steps to Reproduce
I have tried setting the following properties but nothing seems to affect the AOTCompile step:
XCode installed: 16.0
Workloads:
Installed Workload Id Manifest Version Installation Source
android 35.0.7/9.0.100 SDK 9.0.100
ios 18.0.9617/9.0.100 SDK 9.0.100
maccatalyst 18.0.9617/9.0.100 SDK 9.0.100
macos 15.0.9617/9.0.100 SDK 9.0.100
maui 9.0.0/9.0.100 SDK 9.0.100
maui-android 9.0.0/9.0.100 SDK 9.0.100
maui-ios 9.0.0/9.0.100 SDK 9.0.100
maui-maccatalyst 9.0.0/9.0.100 SDK 9.0.100
Did you find any workaround?
Setting UseInterpreter to true drops the build time down to 16.5s however this debugger bug prevents us from using this workaround: https://github.com/xamarin/xamarin-macios/issues/8731 https://github.com/mono/mono/issues/19899
Build logs
msbuild.binlog.zip