Why compilation takes 30 seconds even when there are no changes?

I’ve been trying to improve my compilation time since it’s helpful for small incremental changes. I’ve tried moving Unreal Engine and my project to a SSD drive but the compilation still takes around 30 seconds even when no changes have been made to the code base. My code base is very small containing only 4 classes so this compilation time seems unreasonable.

What happens in the “1> Compiling game modules for hot reload” phase? It’s what takes almost all of the time. Is it IO or CPU bound? Can it use multiple CPU cores?

I’ve been thinking about upgrading from AMD FX-4170 to AMD FX-8350, do you think this would help?

Here’s my compilation log:


1>------ Build started: Project: *, Configuration: Development_Editor x64 ------
2>------ Skipped Build: Project: UE4, Configuration: BuiltWithUnrealBuildTool Win32 ------
2>Project not selected to build for this solution configuration 
1>  Compiling game modules for hot reload
1>  Target is up to date.
========== Build: 1 succeeded, 0 failed, 0 up-to-date, 1 skipped ==========


Hi Scintillo. Compile times and build iteration times are very important to us – we’re working on it! Good news below, but first…

Can you verify that you are working with a version of the engine compiled from GitHub? Games compiled against a version of the engine from GitHub will be slower to iterate on. The reason is because Unreal Build Tool will check to see if the engine source itself was modified, which is a LOT of modules and files to check. If you use a binary version of UE4 (from the Launcher), your incremental builds and hot reload times should be MUCH faster (just a few seconds to start compiling or determine up-to-datedness.)

OK now for the good news. We’re currently experimenting with a whole new approach to incremental UE4 builds. This allows the baseline “up to date” checking to complete in just a second or two! This works even if you have the engine source compiled yourself. This feature is already available in the Master branch on GitHub and enabled by default, if you want to help us test it out. There is only one new workflow change: After you add new source files to your project, you need to regenerate project files (or add the file to the project yourself and save it.)

–Mike

Hey Mike,

I am using 4.7.0 (from master on release day) and building from the source code. Every now and then when I build the game project, the UBT goes through and recompiles a whole bunch of engine files which I did not touch. I just ran a build which took 1232 seconds (about 20 minutes).

I performed a hot recompile within the editor. That caused the editor to crash, so I had to rebuild from within visual studio. Here is the output log of that build:

I’m hoping you guys can use this to help speed up our compile times :slight_smile:

Actually, I am using the stock engine (4.7.2) from the launcher. I haven’t compiled the engine myself. So, you’re saying my build time is abnormally high? Tell me if you need any logs that could possibly help diagnose the problem.