XcodeBenchmark
XcodeBenchmark copied to clipboard
Benchmarks using latest Xcode 13.2 beta `EnableSwiftBuildSystemIntegration`
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!
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
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?
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.
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 🤔
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.
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.
Similar results for me on M1 Max, 64GB, 16"
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.



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.
.
Can anyone confirm if Xcode 13.2 RC fixes the incremental build issue?
@AvdLee #282 #283 #284 😉
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.
@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.
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?
@SalvoSwift21 Yes, you can. Simply send a feedback with a sample code using Feedback Assistant.
Ok @florentmorin, thanks I opened the feedback let's see what they answer.