EnableSwiftBuildSystemIntegration slows down incremental builds

It seems that enabling the build system integration feature in Xcode 13.2 (13C90) severely harms the duration of incremental builds. Our project is split into multiple framework targets. These framework targets mostly don't depend on one another neither in build settings nor in the "Build Phases - Dependencies" tab and do build in parallel.

When the new integration feature is enabled it seems that builds without any changes or with changes to completely unrelated frameworks result in either a complete or almost a complete rebuild of the project. Without the integration feature the incremental build works as expected and build-time wise it seems that only those targets are affected by the change in source code rebuild.

To reproduce this issue I built our project in 3 scenarios switching the integration feature via defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 0/1:

  1. Clean
  2. Change in sources of a single framework
  3. No changes

Without integration feature it is roughly:

  1. Clean - 190 seconds
  2. Change in a single framework - 40 seconds
  3. No changes - 10 seconds

With integration feature it is roughly:

  1. Clean - 190 seconds
  2. Change in a single framework - 130 seconds
  3. No changes - 190 seconds

Why a change in a framework is faster than a no changes build puzzles me but it seems to be that way. I've attached the resulting .xcactivitylog files in the feedback assistant FB9804591 but I also decided to file this post in case someone has a similar issue. Please let me know if I can supply any other information.

3 Likes

I've just noticed that flag in the Xcode 13.2 release notes and tried it out in the excitement. However, I was disappointed as I actually observed ~20% slower builds with the setting enabled. I'm talking about clean builds in the debug configuration on the new M1 Pro.

I'm getting ~50 sec clean build times with the setting turned on, while the same build takes ~40 sec with the setting turned off.

I'm building a Swift package that has ~15 pure Swift dependencies.

1 Like
Terms of Service

Privacy Policy

Cookie Policy