How do I optimize compile times?

There are some good answers here, but just wanted to say—usually I add this flags:

  .filter { $0.type != .binary }
  .forEach {
    $0.swiftSettings = [

which highlights me functions and expressions that take more than 100ms and show a warning. Then I just split those functions/expressions into smaller pieces and it improves compile time greatly.

think there was another discussion not so long ago, not sure if it's helpful or not (from comments see same -warn-long-function-bodies there...