Terribly slow compiles using Xcode 3.2.5 and 3.2.6 - xcode

OS X 10.6.7, Xcode 3.2.6 (although 3.2.5 shows the same behavior), Mac Pro - 2 2.4 GHz Quad w/ 8GB of RAM.
We have several of these machines, all but one are running great. A normal clean/build takes about 5-7 minutes. On the "naughty" machine it takes about 30 minutes.
Before starting the build the machine has over 5 GB of RAM free, CPU utilization usage is practically zero. We can't see anything that would be eating up resources.
This is just a pretty simple iOS project (using gcc 4.2) - nothing out of the ordinary. Once we kick off the build the XIBs are compiled quickly. It isn't until we get into the 15th-16th implementation file (.m) that the build process slows to a crawl. At that point we still have tons of RAM available and there is very little CPU usage.
Any recommendations as to how we might track down the issue with this machine?
Thanks!

Are you building with the release or the debug configuration? Stripping binaries (release configuration) can be pretty time consuming during build times.

Related

PhpStorm high CPU usage when typing

I started to notice something very annoying with PhpStorm lately. Whenever I type code, the CPU usage goes through the roof, like 300% CPU usage. It seems like something goes wrong with one of the processes that starts when I type, like their auto-complete engine.
I had this issue once before and it turned out to be caused by Dropbox. I was editing some code stored in Dropbox and since PhpStorm saves on every keystroke, Dropbox got triggered and started compressing/encrypting my data. However, this time I don't have any Cloud service running and if I check Activity Monitor, it's the PhpStorm process that has the high CPU usage.
Does anyone have any idea what this could be? I'm not running any weird plugins, just stock + the .ignore plugin. My projects all have Git version control configured in PhpStorm.
Already tried reinstalling PhpStorm, unfortunately, this didn't work.
Environment info:
MacBook Pro (Retina, 15-inch, Late 2013)
2.3 GHz Intel Core i7
16 GB 1600 MHz DDR3
macOS Siera 10.12.5
PhpStorm 2017.2.3 build #PS-172.4155.25
java version "1.8.0_101"
Java(TM) SE Runtime Environment (build 1.8.0_101-b13)

Maven build 3x as slow on OSX

I recently got a new Macbook Pro at work and noticed that building our codebase in Maven2 takes about 15 minutes while others on my team with slightly older Macbooks (but similar/same specs) build in about 5 minutes. After asking around, I've found one other person on my team whose builds take 15+ minutes. I'm talking about a fresh checkout of the code, with all of us on the same version of Maven (2.2.1) and Java version: 1.6.0_29, running 'mvn clean install' from the root of the project. Both of us with slow builds are on Lion (10.7.3), while the people with 5 minute builds are on Lion or Snow Leopard. My machine has 8GB RAM with 2.3 GHz i7, so it doesn't seem like that should be a problem. AFAIK, the machine came with Lion (versus upgraded from Snow Leopard) so I don't think it's that it was upgraded in place from Snow Leopard which it seems some people have had issues with. We with the slow builds both have 5400 RPM drives while most of the others have 7200 RPM drives, but alas, one of the other guys with the 5 minute builds has the exact same 5400 RPM drive as us ... so that sort of rules out that theory.
I've run a memory test (checked out fine), run disk verify and permissions repair in Disk Utility (fixed some permission issues, but didn't change build times), disabled swapping, made sure filevault was off, build from a different directory, all to no avail. A few interesting points which makes me suspect an OS issue:
I have a Ubuntu VM on said machine, and doing a 'mvn clean install' in there is even considerably faster than natively in OSX (10 minutes versus 15 minutes)! FYI, the native Ubuntu guys on our team also build around 5 minutes. And when I was running Ubuntu in a VM on my Windows box a few months ago, builds averaged 15-20 minutes.
Building the slowest component of our project by itself takes about 3-4 minutes normally. The interesting thing about this component is that there is very little code in it. In fact, all it is is one test case and 135 MB of resource files. Of the 3-4 minutes, I counted about 100+ seconds of it is sitting on "Copying 63 resources".
Running in OSX Safe Mode, building the aforementioned slowest component took only 42 seconds, of which about 7 seconds were spent on copying the 63 resources.
I'm not sure what else to try at this point, but I feel I'm so close to nailing it down. If it wasn't such a marked difference, I wouldn't worry about it so much, but 15 mins versus 5 mins is huge in my workflow. I don't feel real comfortable about giving my work computer to the Apple Genius guys, and our IT guy's not a Mac person. Reinstalling the OS seems to be the answer I've seen online, but that seems a bit excessive and intrusive. (I realize this is more of an OSX question than a Maven question, probably, but Maven's been my benchmark. I don't notice any other slowness, but it's hard to say without using others' computers)
Has anyone encountered something like this? Any ideas on what to try? Thanks
Run mvn -X ... command on your machine and on fast one and compare times from the log files what tasks/plugins take the most time. That should give you a starting point. The two slowest parts are file system scanning and network access for checking artifacts/dependencies/plugin updates.
The former can be improved by tuning disk access (e.g. cache or switching to the SSD).
The latter can be improved by adding Maven repository manager, such as Nexus or Artifactory that would cache and optimize access to all remote Maven repositories.

Mac OS X Lion 10.7.2 Xcode 4.2 memory issues

I've got MacBook Pro 2011, 15" i7 2GHz 8GB Ram 1333 MHz OS X Lion 10.7.2 all updates installed released to this date.
I have done everything what I can to minimize RAM consumpsion and the only problem I've got at this point is when I run Xcode. I had 4gigs of RAM, than bought 8 gigs and always 've got 10-30 MB of free memory after 3-5 minutes of Xcode running and PAGE INS are 300MB - 700MB. I tried to switch to 32-bit running mode but no change. Can anybody help me please?
Yes. One way is to disable indexing, another is to reduce the number of build processes. These are hidden preferences in Xcode 4 which I have detailed here:
Hidden Features of Xcode 4
I've also made a pretty extensive write up for improving and working with Xcode's resource issues:
Why are xcodebuild and Xcode 4.2 so slow?

Minimum spec for Xcode 4?

So after deciding to install Xcode 4 on my '09 mac mini because of how useful its instruments feature is (opengl stuff), it turns out that my mac mini only barely manages to run it.
In other words, it's crippled. I'm still here waiting for my program to run on the iPhone, and it's stuck with some "NSAutoreleaseNoPool" message.
The thing is, normally I would ask on how to fix that message, but currently XCode itself is frozen and not responding to anything.
Will upgrading from this old mac mini (it only has 1GB ram) alleviate this issue? Would the new mac mini with a 4GB ram upgrade suffice? IIRC it's core 2 duo 2.25ghz as opposed to my current 1.83ghz, would that make enough difference?
edit: not to mention, indexing cripples the performance to an extreme level
Especially when dealing with running VMs (i.e. an iPhone/iOS emulator), RAM is usually the choke point in my past experience.
I would think 4 Gigs of RAM should do it just fine. My Mac Book Pro has 4 Gigs of RAM and runs android emulators all the time and I'm still able to multitask.
Go into an Apple store and tell the guy you wanna demo the latest gen Mac Mini running XCode and its emulators and see if the performance if worth the investment. Its all Apple hardware/software so I don't see why they can't help you out.
8GB Ram
Since you can get already even 16GB Ram in Mac Mini (at least the newest), I cannot see why not take it? More here. Related threads mention very painful experiences with 1/2/4Gt particularly with Xcode 4. As far as I see it, 8Gt is becoming really a must-have, particularly when Xcode turns to 5.
Xcode 4 experiences
Minimum spec for Xcode 4?
http://www.cocoabuilder.com/archive/xcode/303406-xcode-4-system-requirement.html
https://apple.stackexchange.com/questions/14923/what-is-the-minimum-hardware-needed-to-run-xcode-4
Similar gettings slow threads
Xcode 4 configure to use less RAM?
Xcode suddenly very slow

How to disable indexing in Xcode 4?

Not a long time ago I updated Xcode to version 4. This new version spent a lot of time on indexing the project (it's quite large). That's why I would like to disable indexing. Searching through Xcode help and internet gave no results.
Open a terminal window and paste this command:
defaults write com.apple.dt.XCode IDEIndexDisable 1
You'll lose some features (autocomplete, jump to definition, some of the assistants won't work right). But you'll gain back ram and cpu.
For my project Xcode went from using 2 Gigs to a few hundred MB. (which I sorely needed to compile with ;))
Reducing the priority of the XCode process helps:
renice 10 -p PID
You can get the PID from the Activity Monitor or top/ps commands.
This problem has been noticed on this newsgroup:
The crux of it seems to be that XCode4 uses crazy amounts of ram during indexing - like, 5gb or so(!), and thus if you're on a machine with something like 12gb, there's no problem, but if you're on a laptop with only 2gb or so, you'll have some pretty severe paging going on.
I'm guessing apple's internal engineers were all rocking maxed-out mac pros or something.
I ran into either the same problem or something similar. My project includes heavily templated C++. Including those headers in the PCH file solved the problem for me.
My new retina Macbook pro running XCode 4 was extremely slow doing indexing (and everything else). My Mac mini at home was very fast working on the same project!? Turns out it was my anti-virus software - doing a scan of every file read or written on the MacBook. Turning that off sped everything up by a ton.
Slow indexing is not a given. And more memory isn't necessarily better.
I have a medium sized project for work ~ 500 source files. After deleting the derived data, it takes 18 minutes to finish reindexing this project. That's with no other apps open and not doing anything else with the computer. This is on a fairly recent Macbook Pro with 8G of memory and an i7. Horrible, right?
My home machine is a recent Mac Mini with 4G of memory and an i5. On that machine the exact same project takes 40 seconds to completely index.
I don't yet know what the difference is, but I'm working on it.
It's not possible to disable indexing in Xcode 4. Many of the IDE's features are built on top of the index it maintains.

Resources