Speeding up compile times.

I just did a clean/rebuild of my project. I noticed CPU usage was pretty low for the entire time. I was wondering what I can do to dedicate more resources to the task. Maybe there is a non-cpu bottleneck? I also noticed there was little to no disk-reading during the compile, I have an SSD, and the sources should be loaded into memory anyway. Could memory speeds be the bottleneck? If so it looks like going with Quad Channel DDR3 would be better than dropping in an 8 or 16 core CPU. I hate waiting, anyone have some tricks up their sleeves?

Yeah I’m seeing the same results as you, just scaled to my CPU. I think this is a Visual Studio thing. Are compile times that slow on you as to make this a difference?

I don’t know if the Unreal Build System would override this somewhere (wherever they set the /MP switch I’m guessing), but this is the only Visual Studio setting I could find referencing parallel building. Doesn’t seem to make any difference for me, but maybe it’ll make a difference in your project.

If you find where the /MP flag is set by the build system, you can manually specify the number of threads to use, i.e: /MP5 for 5 threads, /MP8 for 8.

To avoid saturating your CPUs & making your machine unresponsive, Unreal Build Tool only kicks off one compilation task per physical core (so hyperthreaded CPUs wont see complete saturation of the available resources when you take a look in task manager).

It is possible to increase this using an environment setting, but you may not see significant improvements.

Add an environment variable:

ue.ProcessorCountMultiplier

This takes a floating-point argument and defaults to 1.0.

I looked into Incredibuild. I’m not done testing things but here’s a screenshot of how it works. It worked right out of the box with the UE4 build system I didn’t have to do anything. I should also not that on larger projects CPU usage hits 100% (with or without incredibuild)

Seems like compiling is pretty much designed as a background job. I would prefer it to just lock up the whole computer for 5 seconds while compiling with full power instead of running on low cpu for 30 seconds.

I know blender does this when tracing ambient occlusion - my music stops playing, the mouse stops moving, and it works full power just on doing that one thing.

Does anyone know whether visual studio can do this too?