XCode 13 is super slow, build time is 10~20 times longer than Xcode 12

XCode 13 is super slow, build time is 10~20 times longer than Xcode 12。The worst release ever.

Post not yet marked as solved Up vote post of wfrobin Down vote post of wfrobin
15k views
  • I find things get faster and "smoother" after I disabled the Source Control in the Preferences...

Add a Comment

Replies

New Build System

Seeing the same behavior with Xcode 13 GM. My project will not finish compiling and doesn't show any errors. If I stop the build I see "Command CompileSwiftSources failed with a nonzero exit code"

To speed up your builds, ensure that your project is optimally configured:

The Xcode Release Notes have been advising moving to the new build system for several releases. If you were still on the legacy build system, it has been removed from Xcode 13, so you are now using the new build system. This build system is faster than the legacy build system, enabling better parallelization of build tasks, but if your project isn't embracing the best practices from those documentation articles, like not correctly declaring build dependencies, you will not see the full performance benefits.

  • Hello, I submitted feedback FB9666668 with a project that has the issue.

Add a Comment

I narrowed this issue down to a single SwiftUI file that causes the problem. When I remove this file the build completes in under 2 minutes. There is a simple code fix for this issue by moving about 10 lines of code into a view it seems to solve it.

I submitted the Xcode project using feedback assistant. The code is too long to post here. I am working on reducing the code down so I can post it once I get to that point.

  • Thank you for opening that Feedback report, we appreciate getting the specific details for your project.

  • @ben.ford: How did you narrow it down to that one file? I don't see file-by-file values in the "Build with Timing" report.

Add a Comment

Yes I am not seeing any incremental builds with 13.2, always seems to do full recompiles now. I don't think 13.1 was this bad! What a nuisance.

I started to experience slow incremental builds after setting the defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1. Once I set it back to 0, restarted Xcode and removed derived data all is looking good. Will take a closer look later what is the actual issue when it's set to 1.

  • Currently using XCode 15.2 & 15.3 on a iMac Pro and I was experiencing the same behavior on projects using Storyboard or SwiftUI...30 seconds or longs stuck on Pre-planning until I switched the EnableSwiftBuildSystemIntegration to 0. Now it's like it was before with zero code changes.

Add a Comment

I'm seeing the same issues particularly on Intel CPUs. Is this some game where M1 CPUs will be optimized and Intel won't? Xcode has always been a ****** IDE honestly compared to other options in the world, but it's getting to the point of unusable.

I shouldn't have to start building apps in React Native just to get apps done because of IDE issues, but I'm sure considering it.

@adamglo

Did that manage to fix things for you? I'm sitting here waiting 3-4 minutes every time I make a minor text change and it's killing me.

I'm having the same issue since upgrading to Xcode v. 13.2.1 (13C100). Build times for super simple SwiftUI project with one view around 2-7 minutes. It's a brand new MBP Apple Silicon.

Version 13.3 (13E113) is worse! Can someone please look into this issue? Build times are 30 minutes for me.

  • same on my side version 13.3 is worst, takes 30 mins for each build even though it is not a fresh build

  • Same on M1 Pro 16GB. Shocking

  • I can confirm this, 13.3 increased build time for at least +33%.

update macOS to 12.3.1 (21E258), and open xcode, xcode will prompt you to reinstall the xcode debug tool, after this, I feel it is a little faster than before.

  • I tried Xcode 13.3 with macOS 12.3.1. But the build time is still 21x slower than Xcode 13.2.1🙁

Add a Comment

Same here macOS 12.3.1 and Xcode 13.3 one line change is taking a lot of time

It's a shame, Xcode has been degrading step by step in performance with each new version since the departure of Steve Jobs, coming now to the point of unusability. Steve, come back, help!

I can confirm that running defaults write com.apple.dt.XCBuild EnableSwiftBuildSystemIntegration 1 in M1Max 64GB made builds WAY slower. Rebuild code went from 3-10s to build to +30s! On every rebuild, even with no code changes.

Well we have fixed our slow build issues by finding out expressions and functions which are taking more time compiling found out critical bottlenecks for slow build time now everything is fast clean build time is reduced from 35 minutes to 206 seconds.

  • It includes remove excess usage of Shorthand notations, Type Inference and longer switch case in closure

  • @ronak1garg1: How did you find out which expressions and functions were taking more time to compile?

Add a Comment