dotnet / maui

.NET MAUI is the .NET Multi-platform App UI, a framework for building native device applications spanning mobile, tablet, and desktop.
https://dot.net/maui
MIT License
22.28k stars 1.76k forks source link

iOS/Catalyst build performance regression from net8.0 to net9.0 #26300

Open jeremy-visionaid opened 3 hours ago

jeremy-visionaid commented 3 hours ago

Description

There's quite a noticeable decrease in performance building iOS and Catalyst apps:

dotnet build -bl:../net8.0-ios.binlog
Restore complete (0.5s)
  MauiTestApp net8.0-ios succeeded (12.6s) → bin/Debug/net8.0-ios/iossimulator-arm64/MauiTestApp.dll

Build succeeded in 13.3s
dotnet build -bl:../net9.0-ios.binlog
Restore complete (0.4s)
  MauiTestApp net9.0-ios succeeded (17.4s) → bin/Debug/net9.0-ios/iossimulator-arm64/MauiTestApp.dll

Build succeeded in 18.1s

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

jeremy-visionaid commented 3 hours ago

Also, the GitHub form won't allow uploading files with the extension ".binlog" which is less than ideal

Ying-6 commented 59 minutes ago

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:

aspnet@Yings-Mac-mini MauiApp1 % dotnet build -bl:../net8.0-maccatalyst.binlog
Restore complete (0.6s)
  MauiApp1 net8.0-maccatalyst succeeded (10.4s) → bin/Debug/net8.0-maccatalyst/maccatalyst-x64/MauiApp1.dll

Build succeeded in 11.5s
aspnet@Yings-Mac-mini MauiApp1 % dotnet build -bl:../net9.0-maccatalyst.binlog
Restore complete (0.6s)
  MauiApp1 net9.0-maccatalyst succeeded (11.6s) → bin/Debug/net9.0-maccatalyst/maccatalyst-x64/MauiApp1.dll

Build succeeded in 12.8s