Skip to content
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

Improve default build times on arm64 #21444

Open
rolfbjarne opened this issue Oct 15, 2024 · 3 comments · Fixed by #21461
Open

Improve default build times on arm64 #21444

rolfbjarne opened this issue Oct 15, 2024 · 3 comments · Fixed by #21461
Labels
Mac Catalyst Issues affecting Mac Catalyst notes-mention Deserves a mention in release notes performance If an issue or pull request is related to performance
Milestone

Comments

@rolfbjarne
Copy link
Member

rolfbjarne commented Oct 15, 2024

The default build times for a Mac Catalyst app on arm64 are horrendous:

  • dotnet new maccatalyst && dotnet build: 1 minute

Enabling the trimmer or the interpreter makes it much better:

  • dotnet new maccatalyst && dotnet build /p:UseInterpreter: 17 seconds
  • dotnet new maccatalyst && dotnet build /p:TrimMode=partial: 12 seconds
  • dotnet new maccatalyst && dotnet build /p:TrimMode=full: 12 seconds
  • dotnet new maccatalyst && dotnet build /p:TrimMode=partial /p:UseInterpreter=true: 12 seconds

So I suggest we enable the trimmer by default for Debug mode on Mac Catalyst (this would match how we handle iOS and tvOS in the simulator + we don't enable the interpreter on any other platform).

The same thing happens for the iOS and tvOS Simulators as well.

@rolfbjarne rolfbjarne added the performance If an issue or pull request is related to performance label Oct 15, 2024
@rolfbjarne rolfbjarne added this to the .NET 10 milestone Oct 15, 2024
@rolfbjarne rolfbjarne added the Mac Catalyst Issues affecting Mac Catalyst label Oct 15, 2024
@rolfbjarne rolfbjarne changed the title Improve default Mac Catalyst build times on arm64 Improve default build times on arm64 Oct 16, 2024
rolfbjarne added a commit that referenced this issue Oct 16, 2024
@rolfbjarne rolfbjarne added the notes-mention Deserves a mention in release notes label Oct 16, 2024
rolfbjarne added a commit that referenced this issue Oct 23, 2024
…1444. (#21461)

The default build times for a Mac Catalyst app on arm64 are horrendous:

* `dotnet new maccatalyst && dotnet build`: 1 minute

Enabling the trimmer or the interpreter makes it _much_ better:

* `dotnet new maccatalyst && dotnet build /p:UseInterpreter`: 17 seconds
* `dotnet new maccatalyst && dotnet build /p:TrimMode=partial`: 12 seconds
* `dotnet new maccatalyst && dotnet build /p:TrimMode=full`: 12 seconds
* `dotnet new maccatalyst && dotnet build /p:TrimMode=partial /p:UseInterpreter=true`: 12 seconds

So enable the trimmer by default for Debug mode on ARM64 on:

* iOS
* tvOS
* Mac Catalyst

(we're already trimming for other build configurations, so it seemed like an easy to choice to enable the trimmer in these configurations as well, as opposed to enabling the interpreter)

Fixes #21444.
@tipa
Copy link

tipa commented Nov 11, 2024

In tests with my real-world apps, build + deploy times to the simulator are ~16 seconds when only specifying UseInterpreter and ~13-14 seconds when specifying both UseInterpreter & TrimMode=partial. Will this change yield similar results? I am asking because in the commit it says

Linking is on by default in the simulator when building for arm64, as long as the interpreter is not enabled

https://github.com/xamarin/xamarin-macios/blob/bc1ae55783c0e0ceb419e9b103b2b09201b9faf8/dotnet/targets/Xamarin.Shared.Sdk.Trimming.props#L57C1-L58C1

@rolfbjarne
Copy link
Member Author

In tests with my real-world apps, build + deploy times to the simulator are ~16 seconds when only specifying UseInterpreter and ~13-14 seconds when specifying both UseInterpreter & TrimMode=partial. Will this change yield similar results? I am asking because in the commit it says

Linking is on by default in the simulator when building for arm64, as long as the interpreter is not enabled

bc1ae55/dotnet/targets/Xamarin.Shared.Sdk.Trimming.props#L57C1-L58C1

Yes, you should get some similar results (probably somewhere between 13 and 16 seconds).

It should be easy enough for you to try it, by building with "TrimMode=partial" (without setting UseInterpreter).

@tipa
Copy link

tipa commented Nov 18, 2024

Only tested with one app, but the build & deploy time to simulator increased from 16 seconds to 21 seconds when removing UseInterpreter=false and using TrimMode=partial only

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Mac Catalyst Issues affecting Mac Catalyst notes-mention Deserves a mention in release notes performance If an issue or pull request is related to performance
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants