Monday, April 25, 2022

How RAM Affects Xcode Compilation Speed

Matt Gallagher:

Xcode alone can fill the RAM on a 16GB system. Yeah, okay, half of that is “Cached Files” (not app memory) so the effect is subtle. Incremental builds are 5% slower compared to a 32GB system but clean builds are about the same. (Blue is 16GB, green is 32GB, lower is faster.)

Everything takes different amounts of RAM based on the total RAM of the system. My 16GB system running Xcode shows 8GB “Memory Used” in Activity Monitor but the 32GB system shows 12GB. (The Xcode process shows just 586MB used, the rest spread around 822 other processes.)

Simulator + SwiftUI previews and all the RAM on a 32GB machine is used. Now, the 32GB machine beats the 16GB one by 10% or more. Don’t be too worried if you can afford only 16GB since the difference is never more than 25%, even with a standard spread of apps in the background.

Without a stopwatch, I can’t tell the two apart – both systems have been equally responsive. But now I’ll add a Parallels Windows VM in the background. An easy 30% performance win to the 32GB machine. Worse: the 16GB machine noticeably stalls when swapping between apps.

Do you need 32GB for iOS dev? No, but memory up to 32GB is rarely wasted when IDEs are involved, even the difference is subtle.

He measured this using an Intel MacBook Pro.

Previously:

Comments RSS · Twitter

Leave a Comment