-
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
iOS/Catalyst build performance regression from net8.0 to net9.0 #110406
Comments
Also, the GitHub form won't allow uploading files with the extension ".binlog" which is less than ideal |
This issue has been verified using latest version VSCode (9.0.10 & 9.0.0 & 8.0.100). Can unstably repro this issue on iOS and MacOS platforms. I verified it 5 times and repro once. Unstable repro information:
|
@Ying-6 Thanks for checking the repro. On my system (Mac Mini M2 Pro), the repro rate is 100%. My figures were for a clean rebuild (git clean -dfx), but the incremental build performance also seems pretty bad. Nearly 20 seconds just to build what's essentially a Hello World app on a relatively fast machine. It wasn't exactly great with net8.0, but net9.0 really negatively affects the build, run, test cycle. |
I verified this issue again on an M1 Mac Mini, changed the framework from net8.0-ios to net9.0-ios, verified it 5 times and the reproduction rate was 100%.
|
Oh wow. Other members of my team use M1s, no wonder there have been some complaints! Though I'm also curious how/why your M1 builds faster than my M2 Pro... 7 or 8 seconds would be OK, but 18 is really pushing the bounds of acceptability. |
M2 ...
|
@jonathanpeppers do you have any thoughts on this one? |
Maybe @rolfbjarne can comment, the difference appears to be the top 2 expensive tasks. Reviewing the .NET 8: .NET 9: The
|
I've looked a bit into this, and this is what I've found so far:
The AOT compilation is also slower, but that shows up better in the next finding:
Timings for only the AOT compilation:
The resulting app bundle is also a bit bigger, but nothing that would explain the almost 3x difference in AOT compilation:
So it seems this is a runtime issue, so moving there. |
This is my test project: TestApp-94f8396.zip Run Then run I get this:
|
I just tested passing
|
Tagging subscribers to 'os-ios': @vitek-karas, @kotlarmilos, @ivanpovazan, @steveisok, @akoeplinger |
Fwiw, I got similar times on my m2 w/ what @rolfbjarne provided. |
After adding this, the time was slightly reduced
|
@maonaoda Thanks for the suggestion, but I assume that only affects Blazor/ASP projects, so wouldn't affect the issue reported here? I don't find it makes any measurable difference. |
Struggling with the same issue on quite big project. Can't share binlog, however I will paste suspicious fragments from it: .net8 MtouchLink=SdkOnly, Target _AOTCompile took 7:27:062
.net9 MtouchLink=SdkOnly, Target _AOTCompile took 49:06.155
.net9 MtouchLink=Full, Target _AOTCompile took 1:48:586
Build time bloated a lot. Unfortunately the app is not ready to be fully linked, SdkOnly is the preferable option for us. |
According to the generated symbols, these generics bloated in .NET 9 within the repro app due to the specialization of types: diff-aot-instances-symbols.txt. The most impactful ones are Disabling dedup optimization (
I suggest enabling dedup optimization in fullAOT mode only: xamarin/xamarin-macios#20687
It is interesting how JIT time increased while generation time decreased. |
That got changed here: with a follow up fix here: and a final fix here: so I'm a bit unsure as to exactly when it's safe/correct to enable/disable dedup at this point. That said, I have a tentative PR up to disable dedup if interpreting every assembly: xamarin/xamarin-macios#21661. |
@rolfbjarne That's awesome, thanks. Maybe the conditions can be improved/tailored, but if it's useful to anyone, I find the following gives a pretty decent productivity bump as a workaround until the above patch gets released.
|
Description
There's quite a noticeable decrease in performance building iOS and Catalyst apps:
The performance regresson is also present for maccatalyst
Steps to Reproduce
The problem is reproducible with a MAUI template project, changing the TFM between net8.0-ios and net9.0-ios
Link to public reproduction project repository
No response
Version with bug
9.0.10 SR1
Is this a regression from previous behavior?
Yes, this used to work in .NET MAUI
Last version that worked well
8.0.100 SR10
Affected platforms
iOS, macOS
Affected platform versions
No response
Did you find any workaround?
Roll back to dotnet 8
Relevant log output
net8.0-ios.binlog.txt
net9.0-ios.binlog.txt
The text was updated successfully, but these errors were encountered: