Performance issues with Xcode 10.2. IDE and simulators.

Please note I did open a bug report on this. Are others suffering through terrible performance on Xcode 10.2? I'm on an iMac Pro 10 core. And it's really slow. Not as slow like when they had issues with Xcode 9 ... but slow.


It's difficult to edit. Even worse if you're compiling or near the end of a compile. Scrolling causes the beach ball to show up. I'd revert back to 10.1 ... but my devices are upgraded to an iOS version that requires Xcode 10.2. I don't feel like downgrading iOS versions just yet.


Compiles are slow. When compiling on my Macbook Pro (also upgraded), project takes 10-15 minutes to compile. iMac Pro takes several minutes as well. Admittedly it is a large project so it did take some time, but now it is much worse.


The simulators are sluggish. Any Apple dialog is show to display and difficult to dismiss. I hadn't experienced that since the terrible/unusable versoin of Xcode 9 with sim issues as well as when I was working on a Macbook Pro.

Replies

Unfortunatly I'm having similar beachball issues with 10.2 Dont even know what to do because like you said, can't really revert. Its making the program unusable at the moment.

It may not be connected with upgrade to Xcode 10.2 by itself. If most of your code is swift and your swift code base is getting bigger you might be hitting that decline in "Xcode performance". What you describe is close to my experience just a few months ago and compile time optimizations totally solved it:


https://github.com/fastred/Optimizing-Swift-Build-Times


I also wrote a blog entry on the problems specific to my code base:


http://plainoldstan.blogspot.com/2019/02/xcode-10-swift-42-slow-autocomplete-and.html


The diagnosis is very similar to yours, it becomes increasingly frustrating to work with the code. When even edit and autocomplete become painful -> look at the compile time optimizations.


Not saying this would be 100% your case. But I've been following the rules of the compile time optimization and I have not had a single issue with Xcode performance in edit/autocomplete/compile area since on my old mbpro 2016.


Also as swift code base is getting bigger, you may look into splitting it into framework/libs. This was a life savior for me as well. Never had to think about this when programming pure objc.

It's pretty bad. I'm a fast typer so the problem is compounded. It's always trying to keep up or even drops keys.


And I'm also finding it crashes quite a bit. Not sure on the trigger. It's usually some command key sequence that seems to trigger it.

I have WKWebview apps that worked great in xcode 10.1... and now 10.2 it says build succeeded but simulators open and crash with error saying WKWebview class not found

I'm having very similar problems, seeing the beachball a lot.


After I do a system restart it seems ok for a few minutes, but then eventually kicks back in.


I also tried deleting and reinstalling xcode.


If anyone gets a solution to this I'd love to hear it

@staninprague thanks for the info. Unfortunately this doesn't apply to me as my code base is C++/Obj-C. I removed any Swift I had because I got sick of updating things every time a new version of Xcode came out (please bear in mind these were the early days of Swift when I did this).


I'll review those linked articles. A cursory view though doesn't seem like it would be entirely applicable. But a bit of new knowledge is always helpful!


My code is also already pretty modular. I have a few key items already in libs. But of course they do fall victim to the occassional (ie. always) Xcode nuances of either not being re-compiled when they should. Or re-compiling even though no changes have been made. I can actually live through that, although it amazes me still how Xcode is still very poor at handling dependencies. The editing and crash issues make it difficult to work effectively.

I solved my probem by adding webkit framework to the build phase link process per:


https://stackoverflow.com/questions/47142434/ios11-wkwebview-crash-due-to-nsinvalidunarchiveoperationexception


It seems an xcode thing as I have swift 4 and 5 projects which the fix above works for.


It seems the new xcode 10.2 did not auto add it, as previous one did; you all may want to add any appropriate framework librarys which

hopefully will speed your process.


GodSpeed to all!

😱😱😱 Apple PLEASE fix this now, I REALLY can't wait any longer!!! This is not a BETA version its the PUBLIC release of Xcode and I can't even launch it anymore without it beachballing!!! A restart hasnt fixed it, deleting derived data used to work but isnt now. PLEASE FIX THIS!

I am seeing major build time regressions with both my Swift and Obj-C projects in Xcode 10.2. It's so bad that my Android apps are now building faster!

That's an awful surprise. I've changed the Optimization Level for Swift Compiler to -Onone, and worked again.

I found this helpful from the swift forums:


https://forums.swift.org/t/longer-compilation-times-with-xcode-10-2-swift-5/22672


In short there is a known bug effecting files with lots of nested types. I've been using the linked too toolchain patch to improve my compile times locally with great success. You can't build to a device with the patch but it greatly speeds of dev time and in my case makes it possibvle to even compile with Xcode 10.2. Hopefullying Apple ships an offical 5.0.1 and of 10.2.1 patch soon.

I would suspect Xcode has numerous performance issues from varying sources. In my particular case, there is no Swift at all. And it also isn't limited to build times. The IDE itself is sluggish to where it beachballs on scrolling and cannot keep up with typing. I'd say 75% of the time, it can't perform Jump to Definition, just provides a spinner. More or less I just end up jumping to the file instead since it's faster.


One would like to think an iMac Pro should have no issues with performance. Sadly not.

Note I updated to 10.2.1. Surprise surprise. Still slow.


I am doing a sysdiagnose and spindump to send to Apple right now.


And to make things even nicer, it seems they have issues with clang too. Library that I've used for quite some time. Code hasn't changed.


fatal error: error in backend: Unexpected end of file

clang: error: clang frontend command failed with exit code 70 (use -v to see invocation)

Apple LLVM version 10.0.1 (clang-1001.0.46.4)

Target: x86_64-apple-darwin18.5.0

Thread model: posix

InstalledDir: /Applications/Xcode.app/Contents/Developer/Toolchains/XcodeDefault.xctoolchain/usr/bin

clang: note: diagnostic msg: PLEASE submit a bug report to http://developer.apple.com/bugreporter/ and include the crash backtrace, preprocessed source, and associated run script.

clang: note: diagnostic msg:

It's 10 years after Apple introduced Xcode, and yet they face issues. Always issues are there with Xcode. I don't understand what actually they are trying to achieve.

Sadly it seems that Apple have moved from "It just works" to "move fast and break things" mentality.

XC 10, all versions, have been like wading through mollasses.

XC 9 was quite responsive in comparison, but canot be used for iOS 12 :-(.

com.apple.dt.SKAgent seems to be the 'source' of the issues, although having a "storyboard" open also kills perf.

FYI No Swift code (only obj-C, until Swift is ready for production code, too many freaking breaking changes: what was Chris Lattener thinking?!) MBPro 2017 2.9GHz-i7 with 16GB Mojave 10.14.4.