Why is Xcode so slow?

I have been developing on a Hackintosh 2.89 GHz Intel Core i5 8 Gb and finally got fed up with waiting about an hour a day while Xcode builds and deploys incremental development code from my watchOS app to either the Simulator or to my iPhone6/Watch 2.

So I have lashed out on a 27" 3.4 Ghz iMac from the friendly Apple Store.


Result - exactly the same! The big screen is a delight, but not worth $AUD 2,700. It's going to have to go back to the Store.


On the first run on the new box, deploying to the Sim (iPhone7/Watch2-38mm) the build timed out while the Sim loaded.


I'm using Activity Monitor to monitor CPU load, Memory usage, and Disk access, and just can't see any bottlenecks:

  • The CPU usage never goes above ~50% across the 4 cores,
  • the memory load never goes more than halfway up the scale
  • There's no Disk load of any size.
  • But, interestingly, there's quite a lot of Network activity during the load which is a bit of a mystery. ~300 mB uploaded during the build and install, I wonder if the issue is some sluggish network traffic that is happening in the Apple world ... but what and why?


Anybody out there with any ideas?

Post not yet marked as solved Up vote post of alan.raceQs Down vote post of alan.raceQs
19k views

Replies

If for any reason, Spotlight indexing is working (you'll see a daemon running with "mds" in its name, I forget exactly what the name is), overall performance suffers terribly, and it runs for many, many hours. Nothing alarming shows up in Activity Monitor, but apps like Xcode are hugely impacted. This often happens on a new system, when a new disk is installed, or after an OS crash/restart.


>> about an hour a day


That's the total time over a day? Not an hour for one build/run, right?

>> On the first run on the new box, deploying to the Sim (iPhone7/Watch2-38mm) the build timed out while the Sim loaded.

I haven't being paying a lot of attention to the issue, but IIRC there were some bugs about registering devices the first time Xcode saw them.

I would suggest not panicking for a couple of days, to let background software updates happen, indexing to finish, and so on. Then restart, and then see how the Xcode ecosystem runs. If things seem slow, use Console to look into the log. If there's stuff being logged constantly, there might be something at fault other than Xcode.


Also, FWIW, a number of times on these forums, someone has complained that Xcode was misbehaving, and days later reported that they forgot they'd installed some hack to sometime a long time ago, and it was no longer compatible.


Lastly, you might try asking back at the Apple Store whether they "feel" your Mac is running abnormally slowly. If they say no, you can get a refund. If they yes, you can get them to fix it. (Well, I doubt it will be that easy. But still.)


For the record, what version of Xcode?

Good report, thanks.

>...there's quite a lot of Network activity during the load which is a bit of a mystery.


Xcode downloads multiple components post-install, from simulators to documentation, while also communicating to the mothership to confirm accounts and feedback per your agreement to share info w/Apple. In your example, I'd speculate those events are coincidental to your build processes, both of which tie things up. Keep an eye on the tool bar for info on activities. Try a different network if you have that option. Boot & run Xcode from a large fast SSD if you have that option as well.


Otherwise, it's not uncommon for the build to time out waiting on the simulator or device. Best to simply try again.


Generally, tho, it seems you're not alone and recent Xcodes are earning more scorn than dev luv - we're all in the same boat, I think.


There may be remedies you can try that are particular to your IDE, but hard to identify without testing - search here on: xcode slow ...filter on the last 90 days, as an example, for recent discussion if you care to chase them down, otherwise, good luck w/the Store - would have been interesting to have tested Xcode on a floor model before buying, but oh well.

Post not yet marked as solved Up vote reply of KMT Down vote reply of KMT

Spotlight indexing ... I see mds_stores and mds running with big chunks of CPU time. Is it something I need? If not, can I disable it?

An hour a day, not a build!

Re the refund... Our local Apple Store (Chatswood Chase, Chatswood, NSW, Australia) offers a two-week return policy - no questions asked. Pretty sweet!

Thanks for the reply

I have no doubt that this is still a huge issue. In my case, I will get random input freezes in the code editor. Typing any key or even clicking the mouse at all will corrupt the editor window within the confines of your text selection. It just decides to do this every so often (~30-40 minutes or so) I have been dealing with this for over 6 months. I have a 2019 iMac, but with 64gb of ram.

If this is actually 'Spotlight' oriented then I would say mac OS is not resourceful enough in this context. Background services shouldn't be noticed.

The solution for me is to simply restart Xcode. This leads me to believe the cause is not Spotlight, although I haven't put this through any sort of diagnosing process.