Hardware recommendations for compiling the Swift project

I’m looking into buying new hardware and would like to get a good enough setup to compile the Swift-project efficiently.

What are your experiences with compiling the Swift project on different hardware?

Is it CPU- or RAM-limited? Does more cores help more than single-threaded performance?
Any indication of if SSD-performance affects compile times?

Also, what compile times are you seeing for a full rebuild and incremental?

That ill depend on which platform you are trying to build it for

How so? :slight_smile:

If your budget is high enough for it to matter, the new Mac Pro is supposed to come out next month. Or at least the web configurator will go live then... I don't recall whether it's actually shipping in December. Either way, though, if you're interested in working on a mac, you might want to wait and see how that machine benchmarks.

In general, building Swift scales very nicely with more cores and RAM but there are bottlenecks that may or may not matter to you. In particular, the standard library does not build concurrently. Maybe someday it will, but not today. If all you want to hack on is the standard library, then clock speed (and L3 cache size) matters more than cores for incremental rebuild performance.

3 Likes

The Mac Pro is a great suggestion, but also likely out of my price range. :money_with_wings:

What I'm after is more about the nuances and performance characteristics of the compilation process to make a better and more well-informed buying decision.

The follow-up question here would be if there has been any work in compilation performance, and if there is any work/interest made in reducing the time to compile the project?

I/O is really important. A full debug build of LLVM, Clang and Swift is > 50GB, and the executable outputs (like the compiler) are like 8GB or something all together. If you regularly change things in the compiler, many of those executables need to be linked every time (which is highly disk-bound, uses basically no CPU).

My old laptop from 2014 does a clean debug build in ~2.5 hours IIRC and incremental builds normally take about a minute (mostly linking), maybe 2 or 3 minutes tops.

1 Like

I just tested a clean build on a new 16" MacBook Pro with 64 GB RAM and the "slow" 8-core i9.

It took just over 45 min for % utils/build-script --xcode --release-debuginfo on 10.15.1 using Xcode 11.2.1 (11B500).

3 Likes