There have been a few answerhub posts about improving C++ Compile times in the past. Previous recommendations have had us adjust the BuildConfiguration.xml parameters for ProcessorCountMultiplier, **MinFilesUsingPrecompiledHeaderOverride **and **bFasterWithoutUnity. **One answerhub thread response from Mike seemed to indicate that those methods were antiquated and that the future (on March 26, 2014) was looking much faster.
I fiddled with the BuildConfiguration.xml processor count setting, bumping it up to 4 but my results were hard to quantify. 40 days ago, I blew away my BuildConfiguration.xml and just started logging data. Here is what 40 days worth of data looks like across the binary 4.8.2 and 4.8.3 engines.
[TABLE=“class: grid, width: 500”]
Compiles / Day
Total Time Spent Compiling (hours)
Time Compiling Per Day (minutes)
Best Time (sec)
Worst Time (sec)
Avg Time (sec)
Median Time (sec)
Hot Compile Crashes
Details on my codebase
- 138 source files (.h + .cpp)
- 42,736 lines of code (according to gitstats)
The vast majority of my compiles are hot compiles (hitting compile from the editor). 19.14% of the time, the hot compile results in a crash after the compile finishes (hotreload bugs ), when this happens, the subsequent compile will be < 2 seconds. These hot-reload crashes tend to skew the data set as they drop the average compile time. In the last 40 days, I’ve gotten 334 of these crashes, so average compile time is a bit worse than it seems.
Details on Hardware
I’m running an i7 with 16 GB RAM on Windows 8. The project is on my SSD where looking at disk performance I monitor disk queue length never exceeding 0.1. This blows away any question of there being an I/O bottleneck I can confirm that no swap space is being used and that there is plenty of free RAM, so much free RAM that I have a 1 GB RAM disk that I use as a scratch area.
CPU seems underutilized during compile, but all cores are active and I’m not getting any thermal throttling.
How I recorded the Data
The original script was to turn my Philips Hue bulb red while compiling. I’ve since added some additional code to log the start and end time of the compile with a python script. The main loop is on a 1-second timer, so start and end time error is +/- 1 second. Here is the primary script.
I think I’ve established a pretty good baseline here and am very willing and ready to make 1 change at a time to see how it affects my build times. Some updated official advice on improving compile times in 2015 would be very welcome. If there’s a piece of data that would help, let me know and I’ll add it to my log collection! Even a 25% increase in compile times would mean 4.3 extra hours every 40 days for me That’s half a workday!
Thanks for the read.