Slow Xcode 11 Objective-C Builds
When I build my app, Xcode 11 appears to stall out completely (dropping from full core usage down to 10-20% CPU) during the Objective-C build phases.
[…]
The bug manifested for me like this:
- Starting with a clean
DerivedData
folder, I can build my app, Capo in about 60 seconds, flat.- Once I clean the build folder using command-shift-K, all subsequent builds will take anywhere from 180s to 500s (in the very worst case, which I’ve not seen for a while now.)
After some back & forth with Apple’s engineers, I learned to turn on
clang
’s-Rmodule-build
flag to see what’s going on behind the scenes. It turns out that—for every Objective-C file that is built—framework modules are being re-built unnecessarily.