After migrating to Swift 3.0 our first time build time now takes 7 minutes when it used to take 1:20. Does anyone know how can I speed this up?
I work on a large project with lots of Objective C files, approximately 640 Swift files, 20 Cocoapod dependencies, a Today View extension and UITests. After the first time build, an incremental build only takes about 10 seconds.
I have run the excellent Build Time Analyzer here: https://github.com/RobertGummesson/BuildTimeAnalyzer-for-Xcode and attached a screenshot below.
It seems that several of the functions in about 20 of the classes are compiled 631 times. This seems like the problem but I don't know how to fix it. No other function or class takes very long to compile on its own.
Almost all of the 7 minute build time is spent on compiling swift files up until this output:
After this line all of the rest of the swift files are compiled and run in about 10 seconds.
It's worth noting that the generated project-swift.h file is 4500 lines long and the bridging-header has 150 lines of imports.