Xcode 4 - slow performance

2020-01-24 01:49发布

I have an issue with Xcode 4 really responding very slowly to user interactions, e.g. editing code, scrolling areas etc. This particularly happens with larger scale projects with many controllers/view files etc.

I completely wiped the hard disk and re-installed Snow Leopard and Xcode the other week but steadily it ground to a frustrating response time again (over a number of days) disrupting workflow considerably.

I have also on occasion removed the project's "derived data" via the Organiser -> Projects and this has had little effect.

I'm wondering if there is anything I can do to improve performance other than get a higher specced machine in the first instance.

FYI I'm running MacBook with Intel Core 2 Duo processors at 2GHz and 4GB of RAM.

In case we need to upgrade I'd also like to know if people are experiencing this poor performance from Xcode 4 on well specced machines (which would make our hardware upgrade rather pointless as it's only Xcode that has any performance issue on the MacBook).

If anybody has any suggestions or recommendations or could even let us know how improved hardware effects Xcode's performance on larger project trees then that would be extremely helpful and also a valuable resource for other devs in a similar position.

17条回答
甜甜的少女心
2楼-- · 2020-01-24 02:22

Disabling Live Issues in General Preferences has made a definite difference. I also setup a scheme without gdb enabled for situations where I'm frequently re-running (no gdb speeds up launch quite a bit).

查看更多
smile是对你的礼貌
3楼-- · 2020-01-24 02:22

You can avoid indexing Xcode. Doing so will improve memory performance of your system but will also prevent IDE features such as autocompletion and jump to definitions from working.

$ defaults write com.apple.dt.XCode IDEIndexDisable 1
查看更多
ゆ 、 Hurt°
4楼-- · 2020-01-24 02:26

For me, Xcode gained a huge performance increase after setting it to run in 32-bit mode (it was 64 by default). It is almost as fast as the old Xcode 3. You can switch to 32 bit by right-clicking the app (in /Developer/Applications/XCode.app) and selecting Get Info and checking Open in 32-bit mode.

查看更多
我命由我不由天
5楼-- · 2020-01-24 02:26

The following post by @lukasz helped a bit, particularly his item #8 in his answer (Closed Utility Panel and Quick Help Pane)

Xcode 4 became extremely slow and kills my hard drive

查看更多
戒情不戒烟
6楼-- · 2020-01-24 02:32

If you purge the workspace file it helps speed it up.

First, make sure Xcode isn't open. Now find your project file. Right-click on it, and select Show Package Contents.

enter image description here

Next, delete project.xcworkspace.

enter image description here

Open Xcode and enjoy faster performance!

Thanks to: http://meachware.blogspot.com/2011/06/speed-up-xcode-4.html


Edit: I've gotten several comments about this noting that for some projects this might cause problems. Make sure you have a backup of your project before performing these steps, and don't forget to check and test your project afterwards. Be sure you still have all of your executables and schemes.

查看更多
登录 后发表回答