More vCPUs, lower build performance (macOS VMs)

Hi everyone,

We're running Xcode/Swift CI builds inside macOS VMs (Tart / Apple Virtualization Framework) on a 32-core Apple Silicon host.

While investigating VM build performance, we noticed a consistent pattern: assigning 24 vCPUs to the VM produces faster overall build times than assigning 26-30 vCPUs, despite the host still showing idle CPU capacity.

With higher vCPU allocations, the build starts by utilizing the CPUs well, but later stages show a noticeable drop in CPU utilization and overall build throughput. In contrast, the 24-vCPU configuration maintains more stable CPU usage and completes the workload faster.

This was observed repeatedly with the same Xcode/Swift workload. The result seems counterintuitive because the VM is not exhausting the available host CPU resources. Our testing identified 24 vCPUs as the current sweet spot, even though the host provides 32 physical cores.

Has anyone observed similar behavior?

Some questions I have:

  • Do Xcode builds stop scaling efficiently beyond a certain vCPU count?
  • Are there known scheduler or virtualization effects when assigning nearly all host cores to a macOS VM?
  • Is there a commonly recommended practice to leave a number of host cores unassigned, even when the host appears mostly idle?
More vCPUs, lower build performance (macOS VMs)
 
 
Q