Faster build times by leveraging multi-core CPU!

How in the world is this not the default and how have I not heard of this before?!?

Buried in this [helpful blog post][littleThings] about making your XCode life easier, is this tip:

Faster build times by leveraging multi-core CPU ?

defaults write com.apple.dt.Xcode IDEBuildOperationMaxNumberOfConcurrentCompileTasks `sysctl -n hw.ncpu`

I tested it on my work project. I cleaned, cleaned the build folder and restarted XCode in both cases. Results:

Before After
23.4 s 13.9 s

Considering how often I build this project in a day (>20 times?) that is a great return on investment, even if it is only minutes.

Caveats #

  1. I am pretty much just cutting and pasting here. So read more if you want to be safe. Messing with defaults regarding cores like that can definitely impact battery life and other stuff.
  2. I don’t know what the default value was. I don’t know how to restore it. I don’t know if/when it will be reset to the default value. I’ll check next time I restart my computer.

[littleThings]: http://merowing.info/2015/12/little-things-that-can-make-your-life-easier-in-2016/

 
20
Kudos
 
20
Kudos

Now read this

Apple Watch Crown Events – Thinking About Discretely Triggered Events

One of the biggest frustration points for me on Apple Watch when working out is that a wet screen does not recognize touches very well. So a workout app that lets me mark a lap, pause the workout, or anything like that is limited,... Continue →