16 comments

[ 6.2 ms ] story [ 68.8 ms ] thread
"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.

I 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

Unfortunately ccache does not help with swift.
True, 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.
Does it require any additional configuration?
> 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.

It actually does reduce build time. Screenshots of the same for the sample project are shown just below.
This is Hacker News, not Hacker Noon.
It 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)