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?

  • 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.

Add a Comment

Accepted Reply

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 do see around 50% of the compilation time in my project is only utilising just a single or couple CPUs at best and yes they appear to be on the efficiency cores. It's only when it gets to the actual compiling does things ramp up.

Add a Comment

Replies

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 do see around 50% of the compilation time in my project is only utilising just a single or couple CPUs at best and yes they appear to be on the efficiency cores. It's only when it gets to the actual compiling does things ramp up.

Add a Comment

See: https://forums.swift.org/t/using-enableswiftbuildsystemintegration-on-m1-max-vs-m1-ultra/

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.

  • @Cibergato I would recommend that you raise a radar with Apple and leave feedback. Without feedback and simply returning the machine may not prompt them to fix this. It seems no one's comparing compilation times on these macs - everyone's raving about their GPU and Video rendering performance (every reviewers is a video editor, go figure). No suggestion would help - Mac Studio is just slow and not an iota faster than a M1 Max when it comes to building large projects on Xcode.

  • Thanks @Smithers. Returning the machine is the only message Apple will understand or worry about. I know we're a small niche but It would be great if they at least acknowledged there is an issue with XCode and large ObjC projects. I'll have to wait for the next Mac Pro Pro or the Mac Serious Studio. Keeping the current Mac Studio for replying e-mails and spending twice as long to build our software is a tad expensive. The 500s it takes is more like 800s. Each file that xCode compiles takes about 3-4 seconds when it was about 0.1s-0.3s on an Intel machine. By the small number of posts I see here, I do not expect Apple feeling much pressure to address anything.

Add a Comment