4 ms·
Xcode Build Optimization – Exhaustive list of ways to speed up your Xcode build
- slacka 7y ago"Definitive Guide"..."Exhaustive"? Really? So why do I only find tips like changing from debug to release, or enabling 'Parallel build' which is enabled by default? And no mention of ccache? It's as simple as $ brew install ccache Which will drop partial compile times from minutes to seconds. I suggest people who are upvoting this actual look at the contents. I'm by no means an expert, but I found this "definitive guide" worthless. My guess is the author was learning how to use Xcode and these are his notes.
- stefan_ 7y agoPresumably bots, like this other submission of op: https://news.ycombinator.com/item?id=20361463 https://news.ycombinator.com/item?id=20361463
- melling 7y agoI believe Swift occasionally has problems with type inference. If you time your builds and functions then you'll see where you need to add an explicit type. I've also noticed image and color Assets take a while for an initial build. For example, this little app of mine takes 25 seconds for a full build, and less than 1 second for an incremental, probably due to the 100 pictures. https://apps.apple.com/us/app/hundred-words/id1469449237 https://apps.apple.com/us/app/hundred-words/id1469449237
- hrishikesh1990 7y agoInteresting points. Will give this a try myself.
- ajconway 7y agoUnfortunately ccache does not help with swift.
- slacka 7y agoTrue, but this supposed "Definitive Guide" has plenty of references to Objective-C where it does help. My point was that I'm not an expert, and I see things missing.
- nnd 7y agoDoes it require any additional configuration?
- saagarjha 7y ago> If you’re not doing a great deal of debugging, it is better to set this to ‘Optimize for Speed’. This will eventually reduce the build time as the compiler will omit the steps of attaching values to the debugger thread. I would expect this to increase build times.
- hrishikesh1990 7y agoIt actually does reduce build time. Screenshots of the same for the sample project are shown just below.
- bluedino 7y agoThis is Hacker News, not Hacker Noon.
- shepting 7y agoIt would be great if this list would include Buck or Bazel and their associated HTTP caches. For us we lowered our clean CI build times from 22 minutes to 4.5 minutes (1 million lines of Swift)
- hrishikesh1990 7y agoThat is something! TODO - research and write about Buck/ Bazel.
- shepting 7y agoThis is a decent sample project to start with: https://github.com/airbnb/BuckSample https://github.com/airbnb/BuckSample
- hrishikesh1990 7y agoGreat! This is helpful :)