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

Benchmarks using latest Xcode 13.2 beta EnableSwiftBuildSystemIntegration #254

Open
AvdLee opened this issue Nov 16, 2021 · 16 comments
Open

Comments

@AvdLee
Copy link

AvdLee commented Nov 16, 2021

The build system and Swift compiler in Xcode 13.2 beta 2 have a new mode that better utilizes available cores, resulting in faster builds for Swift projects. The mode is opt-in, and you can enable globally with the following user default:

defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1

It would be great to see updates on the benchmarks with this setting enabled!

@EthanLipnik
Copy link

Since Xcode normally doesn't use more than 4 cores efficiently, I'm curious if we'd see less than 4 core Macs have an improvement. M1 Macs probably won't have as much of an improvement as M1 Pro/Max

@alexfringes
Copy link

Just ran it on a 14" M1 Max with 64 GB RAM.
EnableSwiftBuildSystemIntegration 0: 95.028s
EnableSwiftBuildSystemIntegration 1: 91.010s
Can create a PR if desired, but unsure how this would be integrated in the list's current structure? @devMEremenko could you provide guidance?

@paulfreeman
Copy link

Just ran this on M1 Mac mini, 16Gb. Also got around a 5% speedup from 130s to 124s.
I've found this benchmark is consistently @ 130s on this configuration, so that's the fastest time I've seen so far.

@AvdLee
Copy link
Author

AvdLee commented Nov 17, 2021

I would love to get insights into how the available cores make a difference, since that can be a differentiator for buying one or another MacBook 🤔

@alexfringes
Copy link

FWIW, after working with this mode enabled for a day, I've noticed that incremental builds seemingly have gotten slower, to the extent that the gains on broader builds are outweighed in (my) everyday workflow.
A quick test seems to support this feeling. Toggling on the new build mode reliably more than doubles the build time of a small change (one string changed in a file that only a handful of other files depend on) from 4s to 10s. Will file a feedback & post in the dev forums in a bit.

@paulfreeman
Copy link

Yes this is definitely happening @alexfringes, incremental builds are taking 30s on my own project now with zero changes. So fun for a benchmark but useless in general. I notice that in my case one dependency in particular is recompiled every time, but all the rest are not, so this seems to be work in progress.

@earltedly
Copy link

Terminal_XcodeBenchmark — -zsh — 140×29 - 2021-11-18 at 15 02 47

Similar results for me on M1 Max, 64GB, 16"

@euwars
Copy link
Contributor

euwars commented Nov 23, 2021

I'm seeing numbers that i'm having a hard time trusting with the flag enabled. ran the benchmark 3 times and getting the same results though.

Screenshot 2021-11-23 at 2 02 43 AM

Screenshot 2021-11-23 at 2 04 14 AM

Screenshot 2021-11-23 at 2 05 56 AM

@BenchR267
Copy link

I'm seeing numbers that i'm having a hard time trusting with the flag enabled. ran the benchmark 3 times and getting the same results though.

You should be able to verify if the flag got applied to the build by checking the build log for Swift build system integration enabled..

@EthanLipnik
Copy link

Can anyone confirm if Xcode 13.2 RC fixes the incremental build issue?

@florentmorin
Copy link

@AvdLee #282 #283 #284 😉

@SalvoSwift21
Copy link

Hi all, I'm trying this new option with official Xcode 13.2.

With Swift build system integrated disabled:

Small project, with Xcode for M1:
The first build time is 27 seconds
second build time 6 seconds
Later builds 0.3 seconds

A complex project, with Xcode under rosetta:

  • The first build 204 seconds
  • Second build 54 seconds
  • Others builds 1 second

With Swift build system integrated enabled:

Small project, with Xcode for M1:

  • The first build 27 seconds
  • Second build 6 seconds
  • Other builds 6 seconds

A complex project, with Xcode under rosetta:

  • The first build 214 seconds
  • Second build 60 seconds
  • Later builds 60 seconds

Practically with Swift build system integrated enabled, the first build is similar if not slower and all subsequent ones are much slower. How do you think this is possible?

I used a MacBook Pro 16 'M1Max 32Gb Ram.

@florentmorin
Copy link

@SalvoSwift21 This option is really new and optimized for large projects. It's the reason why it can be disabled. Today, Apple teams need feedbacks from community projects to improve it.

@SalvoSwift21
Copy link

Ok @florentmorin thanks a lot for the answer, I thought it could already be used with smaller projects as well. Could I do something to help the apple team with these tests?

@florentmorin
Copy link

@SalvoSwift21 Yes, you can. Simply send a feedback with a sample code using Feedback Assistant.

@SalvoSwift21
Copy link

Ok @florentmorin, thanks I opened the feedback let's see what they answer.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

9 participants