I am seeing a weird thing when compiling a large iOS project which is predominantly in Objective C. I have two machines, a Mac Studio Ultra and a MacBook Pro with an M1 Pro.
It appears the time taken to compile on the MBP (M1 Pro) currently 30-50% faster at building the same project when compared to the Mac Studio!!!! Not possible I hear you say...
I have done everything to ensure both systems are identical down to installing the same copy of the same account and settings on both machines.
When I look into the build times in Xcode I can see the time taken to compile the Objective C files. On the Studio a typical file is taking between 5 seconds and 7 seconds per file!!, whereas on the MBP (Pro) the same files are taking 0.7 and 1.2 seconds.
Strangely, when compiling the Swift files in a pure swift project the Studio will beat the MBP (Pro) by around 20% - 30%.
This sounds like a issue with the Studio itself. Is anyone else seeing the same issue?
Yesterday I wiped the Studio clean and reinstalled a fresh build of Monterey. Reinstalled the same software and copied the latest account from the MacBook Pro. I'm still seeing the slow objective c compiles!
Further investigation, checked Compiler settings to other projects I have in Objective-C they look similar and the differences do not look as if they would matter. These other Obj-C projects compile as fast on the Ultra and the time taken in the same ballpark. The only thing I see which is a big difference with these slow Obj-C files is the totally crazy size of -I includes in the compile statement. As far as I understand it, a lot of these -I includes are auto-generated from the various frameworks we need to include in our build via Carthage. Looking at a single file I can count 2825 -I statements!!!! But why would this affect an Ultra system more when compared to an M1 Pro machine? Perhaps I'm going down the wrong rabbit hole, but that is the only thing I am seeing different at the moment.