Slow Objective C compile speed on Mac Studio Ultra

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?

Answered by Smithers in 710987022

We're seeing the same issue - our Mac Studio Ultra is 0% faster than MBP M1 Max for all our ObjC projects. This isn't an issue with the studio - it's being under utilized it seems by Xcode / clang. We've got a fairly large project, it takes around 200 seconds to compile on a M1 Max and exactly the same time on a Mac Studio Ultra.

What's more annoying to see is that the Mac Studio seems to prefer using the 4 Efficiency cores instead of the Performance cores, even though it's presumably got unlimited power draw compared to the macbook pro. In my opinion I believe the Mac Studio should never need to use the efficiency cores other than for background processing, yet I see the 4 cores utilized (in Activity Monitor) plus a couple of Perc cores, while the rest sit there doing nothing most of the times during compilation.

I've also tried to use a RAM disk to eliminate any I/O delays but I've had minimal overall gains. I would recommend you open a Feedback with Apple (using the Feedback Reporter) as I have too: FB9970366

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.

Accepted Answer

We're seeing the same issue - our Mac Studio Ultra is 0% faster than MBP M1 Max for all our ObjC projects. This isn't an issue with the studio - it's being under utilized it seems by Xcode / clang. We've got a fairly large project, it takes around 200 seconds to compile on a M1 Max and exactly the same time on a Mac Studio Ultra.

What's more annoying to see is that the Mac Studio seems to prefer using the 4 Efficiency cores instead of the Performance cores, even though it's presumably got unlimited power draw compared to the macbook pro. In my opinion I believe the Mac Studio should never need to use the efficiency cores other than for background processing, yet I see the 4 cores utilized (in Activity Monitor) plus a couple of Perc cores, while the rest sit there doing nothing most of the times during compilation.

I've also tried to use a RAM disk to eliminate any I/O delays but I've had minimal overall gains. I would recommend you open a Feedback with Apple (using the Feedback Reporter) as I have too: FB9970366

I'm seeing the same behaviour on my M1 Ultra w/ 128GB.

It has been 'Time Machined' from an iMac 2019 3.8GHz- 8 w/ 128GB My project is 95% Objective C, about 450k lines of code (6k files) with additional 50k lines from Pods.

Both machines were running on macOS Monterey Beta 12.4 ( I know, a Beta). I tried the RAM Disk route as well.

On the old iMac, a clean iOS build takes 400s. On the M1 Ultra, 500s.

I'm planning on returning it right away so any suggestions would be great!

My experience with Apple's support has been abysmal every single time, for the past years, frustrating to say the least so I'm really in no mood to repeat the process.

I tried the XCode benchmark here, with a not so distant result of 75s. The 'official' stat for M1 Ultra, is 67s https://github.com/devMEremenko/XcodeBenchmark

I tried to set PBXNumberOfParallelBuildSubtasks and IDEBuildOperationMaxNumberOfConcurrentCompileTasks to 20, 8, or 6 with no significant improvements.

Slow Objective C compile speed on Mac Studio Ultra
 
 
Q