5

I'm comparing Xcode build times for my project on two machines:

  1. A 2019 Mac Pro with 28 cores and 192 gb of RAM.
  2. A 2019 Macbook Pro with 8 cores and 64 gb of RAM.

The Macbook Pro can build it in 27.6 seconds. The Mac Pro can build it in in 52.2 seconds. This is disappointing, to say the least.

I'm building this project: https://github.com/gnachman/iTerm2

The build configuration is Debug. The optimization level is set to None. There is no Swift: just C, Objective C, and interface builder XIBs. I'm using Xcode 11.3 on both machines on macOS 10.15.1.

Build time summary for Mac Pro:

CompileC (728 tasks) | 1673.157 seconds
CompileXIB (58 tasks) | 649.565 seconds
TiffUtil (121 tasks) | 36.980 seconds
ProcessPCH (5 tasks) | 16.840 seconds
CopyPNGFile (26 tasks) | 12.200 seconds
StripNIB (1 task) | 9.133 seconds
CompileMetalFile (21 tasks) | 6.290 seconds
CompileAssetCatalog (1 task) | 1.688 seconds
Ld (2 tasks) | 1.528 seconds
Libtool (3 tasks) | 1.098 seconds
CodeSign (7 tasks) | 0.768 seconds
PhaseScriptExecution (1 task) | 0.248 seconds
MetalLink (2 tasks) | 0.222 seconds
DataModelCompile (1 task) | 0.171 seconds
ProcessPCH++ (2 tasks) | 0.053 seconds
Touch (1 task) | 0.003 seconds

Build time summary for Macbook Pro:

CompileC (728 tasks) | 290.118 seconds
CompileXIB (58 tasks) | 12.626 seconds
ProcessPCH (5 tasks) | 9.958 seconds
TiffUtil (121 tasks) | 5.955 seconds
CompileMetalFile (21 tasks) | 5.135 seconds
CompileAssetCatalog (1 task) | 1.283 seconds
Ld (2 tasks) | 1.143 seconds
CopyPNGFile (26 tasks) | 1.102 seconds
CodeSign (7 tasks) | 0.734 seconds
Libtool (3 tasks) | 0.332 seconds
PhaseScriptExecution (1 task) | 0.197 seconds
DataModelCompile (1 task) | 0.196 seconds
MetalLink (2 tasks) | 0.083 seconds
ProcessPCH++ (2 tasks) | 0.046 seconds
StripNIB (1 task) | 0.012 seconds
Touch (1 task) | 0.001 seconds

Notably, CPU utilization on the Mac Pro is abysmal. It stays around 30%:

Mac Pro Power Gadget Screenshot

The Macbook Pro is able to peg the CPU at 100%:

enter image description here

Has Amdahl's law bitten me? The single-core performance is definitely worse on the Mac Pro, which is to be expected given the lower base clock rate. PCH building takes about 5 seconds longer on the Mac Pro, but everything else parallelizes well so that doesn't explain it.

For more detail, see build logs with timestamps:

https://pastebin.com/AFcjUuFL https://pastebin.com/yWdN27S8

  • So naturally you'd want to speed it up, or want to know about the reasons? apple.stackexchange.com/questions/92645/… apple.stackexchange.com/questions/282659/… you are encouraged to search some more CPU/ performance questions around. – ankii Dec 21 '19 at 6:28
  • It's not I/O contention. I put everything in a ramdisk and it made no difference. It might be blocked on memory bandwidth, but I'm not sure how to measure that. Throttling isn't an issue based on the screenshots I posted. Although the clock speed is lower, I’d have expected more cores to make up the difference. I guess my question is if there’s any remediation or if this is just the wrong machine for this workflow. – user2551 Dec 21 '19 at 6:55
  • The CopyPNGFile task is a order of magnitude slower on the Mac Pro; a task presumably bound by I/O. Do you see this task's performance difference from a project on the built-in solid state drive? – Graham Miln Dec 21 '19 at 7:37
  • Here's a pastebin of iostat while building: pastebin.com/avjaQ3ZE Build time is the same when both source and destination are in a ramdisk. The ssd's bandwidth tops out north of 2500 mb/sec, so this is only using 1% of its capacity. – user2551 Dec 21 '19 at 17:26

Browse other questions tagged .