Very slow tab switching in Xcode 4.5 (Mountain Lion)

XcodeMacosxcode4.5

Xcode Problem Overview


I recently updated my MacBook Pro (2.3 GHz Intel Core i5) from Lion to Mountain Lion and simultaneously upgraded Xcode to the latest 4.5 version. I've experienced one very irritating problem. While programming I'm used to have a couple of tabs opened at a time. Ever since I updated, each time I switch tabs, Xcode freezes up for a bit (a couple of seconds). Does anyone have a suggestion to solve this problem?

I followed a tip on deleting project.xcworkspace to improve performance. Which seamed to help, but only for a short period of time.

Xcode Solutions


Solution 1 - Xcode

It's a common issue and was fixed in XCode 4.5.1.

https://devforums.apple.com/thread/167765?tstart=0

Solution 2 - Xcode

If you have multiple partitions (maybe a backup of Lion was kept) ensure that xcode really comes from the Mountain Lion partition.

The App Store App update for Xcode seems to take the first Xcode.app it finds and will apply any update to that version. In my case it updated the (inactive) Lion partition, even so I booted from the ML partition. xcode-select did not complain when I tried to change it to the ML version.

So I ended up doing the great housekeeping:

  • do a chmod 000 /Volume/<old Lion partition>/Applications/Xcode.app
  • installed a fresh copy on Xcode.app into /Applications
  • verify the destination of the dock icon (must point to the ML Xcode.app)

My Xcode is now fast as before and it remains fast. You can get the Xcode dmg and the command line tools from https://developer.apple.com/downloads/index.action. I don't think there is a difference in the binaries, but with the DMG I could see where I dropped the Xcode.app.

Solution 3 - Xcode

I found your question before I discovered a partial solution.

As of today, I find XCode 4.6.1 GUI dog slow for my taste, specially considering that I run on a one year old mac, SSD, compile to a 2GB RAM disk and still have 6GB RAM left. Even Eclipse runs lightning fast compared to XCode

4.5.1 did improve something, but after a long time using XCode I do not have any hope for some of its problems being solved ever.

That being said, I have noticed that "Live issues", the main tool bar and all the panels slow down tab switching to same degree. The biggest offender so far are the navigator panels.

Once I got used to a minimalistic Xcode window, layout some specific task tabs, keep a separate window for xibs and learned the shortcuts to enable/disable the panels, I no longer suffer so much with XCode responsiveness, but there is still some lag that can be clearly felt.

Solution 4 - Xcode

Check that there is not heavy coding on ViewWillDisappear. Also if you have NSURLConnection or any other having delegate methods should not get called while switching tabs.

Attributions

All content for this solution is sourced from the original question on Stackoverflow.

The content on this page is licensed under the Attribution-ShareAlike 4.0 International (CC BY-SA 4.0) license.

Content TypeOriginal AuthorOriginal Content on Stackoverflow
QuestionAnden87View Question on Stackoverflow
Solution 1 - XcodeNitzan WilnaiView Answer on Stackoverflow
Solution 2 - XcodeOlafView Answer on Stackoverflow
Solution 3 - XcodeSystematicFrankView Answer on Stackoverflow
Solution 4 - XcodeAmeet DhasView Answer on Stackoverflow