Xcode 4-성능 저하
Xcode 4와 관련하여 코드 편집, 스크롤 영역 등 사용자 상호 작용에 매우 느리게 응답하는 문제가 있습니다. 특히 많은 컨트롤러 /보기 파일 등이있는 대규모 프로젝트에서 발생합니다.
나는 하드 디스크를 완전히 지우고 다른 주에 Snow Leopard와 Xcode를 다시 설치했지만 꾸준히 작업 흐름을 방해하는 좌절 된 응답 시간 (몇 일에 걸쳐)에 지속적으로 도달했습니다.
또한 때때로 Organizer-> Projects를 통해 프로젝트의 "파생 된 데이터"를 제거했으며 이는 거의 효과가 없었습니다.
첫 번째 인스턴스에서 더 높은 사양의 컴퓨터를 얻는 것 외에 성능을 향상시키기 위해 할 수있는 일이 있는지 궁금합니다.
참고로 2GHz 및 4GB RAM의 Intel Core 2 Duo 프로세서가 장착 된 MacBook을 실행하고 있습니다.
업그레이드가 필요한 경우 사람들이 잘 지정된 컴퓨터에서 Xcode 4의 성능 저하를 경험하고 있는지 확인하고 싶습니다 (MacBook에서 성능 문제가있는 Xcode 뿐이므로 하드웨어 업그레이드가 무의미합니다).
누구든지 어떤 제안이나 권장 사항이 있거나 더 큰 프로젝트 트리에서 Xcode의 성능이 어떻게 하드웨어에 영향을 미치는지 알려줄 수 있다면 그것은 매우 도움이 될 것이며 비슷한 위치에있는 다른 개발자들에게도 유용한 리소스가 될 것입니다.
작업 공간 파일을 제거하면 파일 속도를 높이는 데 도움이됩니다.
먼저 Xcode가 열려 있지 않은지 확인하십시오. 이제 프로젝트 파일을 찾으십시오. 마우스 오른쪽 버튼으로 클릭하고을 선택하십시오 Show Package Contents.

그런 다음을 삭제하십시오 project.xcworkspace.

Xcode를 열고 더 빠른 성능을 즐기십시오!
덕분에 : http://meachware.blogspot.com/2011/06/speed-up-xcode-4.html
편집 : 일부 프로젝트의 경우 문제가 발생할 수 있다는 점에 대해 몇 가지 의견을 얻었습니다. 이 단계를 수행하기 전에 프로젝트를 백업했는지 확인하고 나중에 프로젝트를 확인하고 테스트하는 것을 잊지 마십시오 . 여전히 모든 실행 파일과 구성표가 있어야합니다.
중요 업데이트 : Xcode 6의 경로가 변경되었습니다 (댓글 dcc에 감사드립니다)! 방금 다른 방법을 추가했습니다.
다음 코드 줄을 사용하여 램 디스크를 만들어 빌드를 빠르게하는 또 다른 좋은 방법이 있습니다.
diskutil erasevolume HFS+ "ramdisk" `hdiutil attach -nomount ram://8475854`
약 4GB 크기의 인 메모리 디스크 이미지가 생성됩니다. 그러나 메모리가 충분해야합니다. 물론 2GB와 같은 더 작은 이미지 (4237927)를 만들 수 있습니다.
그런 다음 Xcode에 파생 데이터를 저장하도록 지시하십시오. 
Xcode에 iPhone Simulator 데이터를 직접 저장하도록 지시 할 수는 없지만 다음을 수행하여 Ramdisk에 폴더를 작성하고 iPhone Simulator 디렉토리 대신 기호 링크를 작성할 수 있습니다.
Xcode 6 :
cd /Volumes/ramdisk
mkdir CoreSimulator
rm -R ~/Library/Developer/CoreSimulator
ln -s /Volumes/ramdisk/CoreSimulator ~/Library/Developer/CoreSimulator
이전 Xcode 버전 :
cd /Volumes/ramdisk
mkdir iPhone\ Simulator
rm -R ~/Library/Application\ Support/iPhone\ Simulator
ln -s /Volumes/ramdisk/iPhone\ Simulator ~/Library/Application\ Support/iPhone\ Simulator
이 설정으로 시뮬레이터를 빌드하면 즉시 작동합니다. :)
컴퓨터를 다시 시작하면 램 디스크가 사라 지므로 시작시 실행되는 스크립트 나 무언가를 만드는 것이 좋습니다. 그리고 당신이 간직하고 싶은 데이터를 배치하지 마십시오 !!!
2013-03-12 업데이트 :
- 아래에서 Francisco Garcia의 의견을 읽으십시오! 
- 새로운 MBP (SSD 드라이브 포함)에서는이 방법이 더 이상 필요하지 않습니다. Xcode는 지옥처럼 실행됩니다 :). 이것이 큰 과일 문제에 대한 광고로 보이지 않기를 바랍니다. 경험 보고서 일뿐입니다 ... 
일반 기본 설정에서 라이브 문제를 비활성화하면 명확한 차이가 있습니다. 또한 자주 재실행되는 상황에 대해 gdb를 사용하지 않고 구성표를 설정했습니다 (gdb가 실행 속도를 크게 높이 지 않음).
이것이 이것이 누구에게 도움이되는지는 모르겠지만 XCode는 32 비트 모드 (기본적으로 64)로 실행되도록 설정 한 후 성능이 크게 향상되었습니다. 그것은 기존의 엑스 코드 (3)과 같이 마우스 오른쪽 버튼으로 클릭 (의 응용 프로그램에 의해 32 비트로 전환 할 수 있습니다 거의 빠르고 /Developer/Applications/XCode.app )와 선택 정보 가져 오기 및 점검 32 비트 모드에서 열기를 .
Xcode 4.2, 4.3 :
파일 인덱서 (Spotlight를 실행하는 동일한 코드, 몇 년 동안 버그가 있었습니까?)와 관련된 주요 문제.
"감시"파일과 관련된 모든 비 필수 항목을 비활성화하십시오.
- Quick Help (NB: never click on the QH tab! Even hiding the Assistant still causes the code to run! Switch to a different tab before moving to a new file...)
- SCM management (SVN, Git, etc - Xcode's git support is still a little buggy (can corrupt projects), and they've dropped SVN support, so you shouldn't be using it anyway!)
- try deleting your workspace folder (as per accepted answer), but only if its large on disk
- ...anything else you can find related to status of individual files
Xcode 4.4, 4.5:
These versions have a major mem leak, a broken file indexer (but better than 4.2 and 4.3), and maybe a private swap file problem.
Eventually, by disabling/enabling swap space ( how to disable or enable swapping in mac os x ) , and using normal hard drives on several machines, and by running experiments on machines with 2 GB RAM up to 16 GB RAM, I found that Xcode seems to run its own swap-space, independent of the OS X swap (!).
(this might be a mistake - maybe there's an extra form of OS X swapping I dont know about - but the system swap files didn't get larger or smaller, while disk space jumped by gigabytes up and down on some machines)
Observed:
- Xcode 4.4/4.5 will randomly take all the RAM in your system (10's of GB for a tiny project) so that the rest of the system grinds to a halt, stuck waiting for disk swapping - WORSE: on macbooks with SSD's, you won't know this has happened
- WORST: ...even though it's possibly damaging your hard disk (SSD's don't like thrashing writes)
 
- Xcode will hog access to the hard-disk so it can do its (broken) internal file indexing. When system memory gets low, and OS X needs to do swapping ... it gets stuck waiting for Xcode to index files ... and Xcode takes more memory while it waits ... and: BOOM! on smaller systems, OS X eventually hangs 
- Xcode does not need OS X swap space 
The last one is very interesting. If you have a lot of memory (e.g. 16 GB), try disabling swap space permanently. Xcode runs faster, because OS X Lion has some bugs in the mem management where it swaps even when it doesn't need to.
If xcode slows suddenly, it's swapping internally, at which point you can just kill and restart it.
(if you have an SSD, the only way you can know if its started swapping is to wait for it to "get slower". Otherwise, you know as soon as you hear the HD thrash: there's no system swapfile any more, so the only possible cause is Xcode)
You can safely disable swap even if you have 2GB RAM (I had only one OS X crash per month when I tried this, ran it this way for a year), but it will stop you doing high-end video / graphics work with files that need multi-gigabytes just to run. Feel free to try it for a few weeks and see what happens.
But ... restarting Xcode whenever it slows down works wonders. On machines with less RAM, Xcode's private swapfile seems to get IMMEDIATELY deleted when you close down (doesn't seem to happen on machines with lots of RAM)
None of these responses really improved performance in my case (over time Xcode 4.1 became hardly usable, only quitting it now and then helped).
However, I just found out that if I keep closing all my documents (control-command-W) it seems to stay fast. Xcode automatically keeps all the documents that you click on in memory somehow, and you can navigate between them with control-command left/right arrow. If you accidentally open too many (especially IB windows), it crawls to a halt. Just closing all open docs now and then seems to alleviate this without the need to do a full restart.
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
Everybody experiencing these issues should try Xcode 4.1 on Mac OS X Lion. I am surprised how much faster and responsive it is on the same hardware (Macbook Pro 2.66 GHz Core 2 Duo with 4GB of RAM here).
I suppose they fixed tons of performance bugs with this release.
I'm facing the same issues, the were partly fixed since the beta builds but are still persistent. It seems that Xcode internally got one (or more...) leaks which are floating your memory, you can watch this nifty "feature" very well when using the integrated Interface-Builder. Two possible solutions beneath praying and filling bug-reports to apple:
- Don't use internal Builder, launch the external application instead
- Quit Xcode from time to time, this should free the memory which was leaked
Sorry, but I think there aren't any better solutions....:/
Fire up Instruments with the time profile template and attach it to the running Xcode (or clang, llvm, etc. if your problem is during builds). You should be able to see the problem pretty quickly. I have seen very different causes on different machines. Version control is often a culprit.
I've tried just about everything that was suggested in this thread and [numerous] others and the only thing that worked for me was to "disable" subversion for the project. Here's the crappy part -- the ONLY way I could "disable" the built-in SVN plugin was to frig my /etc/hosts file with a bogus IP address, effectively causing all SVN access to fail.
I tried removing/renaming the IDESubversion.ideplugin in /Developer/Library/Xcode/PrivatePlugIns, but Xcode 4.2.1 pukes and refuses to start.
I tried removing my SVN repositories from Xcode each and every time I restart Xcode, but Xcode crashes within a few minutes.
I tried turning off "Remote Status" via File->Source Control->Hide Remote Status (did nothing for me).
Now that I've set my SVN hostname to 1.2.3.4 in my hosts file, Xcode works great and doesn't show the SBBOD almost every time I switch between files.
$ grep 1.2.3.4 /etc/hosts
1.2.3.4 svn.myhost.com
Then, when I really want to do version control, I have to un-frig the hosts file and use cmd line svn.
I've found a trick to accelerate the compiling performance of XCode 4:
When you run or compile or any other processing in xcode and it stall open active monitor and select xcode process then click on sample process. It will make the process to unstuck and run again as normal which allow to build app in a reasonable time. At least this works for me.
Will
In my case it was the RAM usage.

Try to kill few Chrome tabs, or rarely used apps. This should help!
I finally got my xcode work normal by turn off the git feature.
Lots of good suggestions here, I resolved my issue by disabling snapshots as described here:
Editing storyboard in Xcode 5 is very slow
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
인터페이스 작성기 / 편집기로 .xib 파일을 수정하는 동안 성능이 느리다면 File Inspector에서 .xib를 찾아서 자동 레이아웃을 비활성화하십시오 . .xib를 편집 한 다음 마지막 단계로 자동 레이아웃을 다시 활성화하고 구속 조건을 추가 또는 조정하십시오.
참고 URL : https://stackoverflow.com/questions/6355667/xcode-4-slow-performance
'Programming' 카테고리의 다른 글
| 텍스트 영역 변경 감지 (0) | 2020.07.03 | 
|---|---|
| 단위 테스트를 작성하는 방법? (0) | 2020.07.03 | 
| "목록 유형의 표현식에 확인되지 않은 변환이 필요합니다 ..."는 어떻게 수정합니까? (0) | 2020.07.03 | 
| Flink와 Storm의 주요 차이점은 무엇입니까? (0) | 2020.07.03 | 
| 코 틀린의 자원 활용 (0) | 2020.07.03 |