Ever since Swift 3 and Xcode 8 my project compiles quite slowly. Every time I add so much as an empty line to a file, recompiling takes a full minute. When I check the outpu
One common practice that slows down compile time is using Array.append and String.append (or their + operator equivalents). For Strings, it's better to use a formatted string, so instead of
let hello = "Hello, "
let world = "World!"
let combinedString = hello + world
you should use
let combinedString = "\(hello)\(world)"
I can't remember the exact speedup, but it was on the order of 10 times for those particular lines. Odds are, thought, that this won't have a noticeable speedup for any but the tinest projects. For example, our project has hundreds of Swift files, as well as many Objective-C ones, and our compile times are often 10 minutes or more, sometimes even when the only change was to a non-Swift file.