Faster Mix-and-Match Builds with Precompiled Bridging Headers
An examination of build times of Xcode projects that mix Objective-C and Swift, which can contain large bridging headers, shows that the Swift compiler spends a lot of time re-processing the same bridging headers for all the Swift files in a project. In certain projects, each additional Swift file increases the overall build time noticeably, even when the Swift file is quite modest.
→ swift.org/blog/bridging-pch/
Build times in Xcode projects that mix Objective-C and Swift rise due to the Swift compiler re-processing large bridging headers for each Swift file. Swift 3.1 fixes this by adding a mode to precompile bridging headers once and reuse the result across all Swift files in a target.
This mode cuts debug build times by up to 30 percent in some projects but does not affect whole-module-optimisation builds. Developers can try it in Swift 3.1 snapshots or Xcode 8.3 beta by adding the flag -enable-bridging-pch
to Other Swift Flags. Report issues or feedback through bug trackers or the swift-users mailing list.
Category:
Tags:
Year: