Very long compile time - Unreal Engine 4.22.3 & Visual Studio Code

Hello!

I am completing the Bulls and Cows game of the Unreal Engine C++ Developer course. I have been experiencing very long compile times using Unreal Engine 4.22.3 and Visual Studio Code. I followed every step of the solution given by Sam in lecture “52. Solving Slow Compile Times”. It does not work for me.

Every time I make a change in the code and I hit compile, it takes from 250 to 450 seconds (7.5 minutes) to finish. This is really frustating and I cannot make much progress in the course due to this. With the Unity Engine, the compile times took only 1 to 3 seconds using the same computer. My pc specifications as provided in “System information” are:

Intel core i7-4500U CPU @ 1.8GHz 2.40 GHz
8 GB of RAM
Windows 8.1, OS of 64 bits, x64 processor
NVIDIA GeForce 840M

If you have any suggestions, please let me know.

This is what is shown in the Compiler Log:

Using Visual Studio 2019 14.27.29110 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110) and Windows 10.0.18362.0 SDK (C:\Program Files (x86)\Windows Kits\10).
Building 4 actions with 4 processes…
[1/4] BullCowCartridge.cpp
[2/4] UE4Editor-BullCowGame-1437.lib
Creating library C:\Users\Carlos\Desktop\Unreal\BullCowGame\BullCowGame-starter-kit\Intermediate\Build\Win64\UE4Editor\Development\BullCowGame\UE4Editor-BullCowGame-1437.lib and object C:\Users\Carlos\Desktop\Unreal\BullCowGame\BullCowGame-starter-kit\Intermediate\Build\Win64\UE4Editor\Development\BullCowGame\UE4Editor-BullCowGame-1437.exp
[3/4] UE4Editor-BullCowGame-1437.dll
Creating library C:\Users\Carlos\Desktop\Unreal\BullCowGame\BullCowGame-starter-kit\Intermediate\Build\Win64\UE4Editor\Development\BullCowGame\UE4Editor-BullCowGame-1437.suppressed.lib and object C:\Users\Carlos\Desktop\Unreal\BullCowGame\BullCowGame-starter-kit\Intermediate\Build\Win64\UE4Editor\Development\BullCowGame\UE4Editor-BullCowGame-1437.suppressed.exp
[4/4] BullCowGameEditor.target
Total time in Parallel executor: 352,00 seconds
Total execution time: 408,87 seconds

Hello there! I believe that they’ve added a separate l lecture in the BullsAndCows section about how to fix that particular issue.

Hi!

Yes, I followed every step of the solution given by Sam in lecture “52. Solving Slow Compile Times” but sadly, it does not seem to improve the performance for me. Any other suggestions? Thanks in advance

Compile speed also depends on your specifications

Perhaps restart Unreal Engine. If that doesn’t work either, then you should probably invest on an SSD since (theoretically) it would make the compile speed faster.

If your someone who utilizes a lot of programs at once (For example: 10 tabs opened in your search engine, Discord, Steam, an antivirus application, etc) then you should also consider investing in to more RAM lol

What kind of changes to the code are you making? That lecture is specifically about stopping reflection generation being run even when it doesn’t need to i.e. (in a nutshell) when no header file change has been made.

Hi Dan, thanks for your reply!

So, I am making the same changes that the instructor performs in the code. When there are changes in the header file, then I get the longest compile times, but when I only modify the cpp file, the compile times still seem very long (that’s why I mentioned the 250 to 450 seconds in my initial question). Any suggestions?

Then that sounds about right then. It has once taken me over 10 minutes to compile.

Hello,

So, I managed to finally improve the performance. In case anyone has this issue, I recommend the following:

  1. Try the solution that Sam gives in lecture “52. Solving Slow Compile Times”, hit Compile in Unreal Engine and save the changes
  2. Close both Unreal Engine and Visual Studio Code
  3. Open BullCowGame.uproject with Unreal and go to File > Open Visual Studio Code
  4. In VSCode, open UnrealHeaderTool.target and add a space again just as Sam described in lecture 52. Save the changes.
  5. Go to Unreal Engine > File > Refresh Visual Studio Code Project
  6. Hit Compile in Unreal. This may still take some time to compile. After that, you can modify the cpp file and it should be much faster (now it compiles in 10-15 seconds for me). Note that if you add changes to the header file, the compile time will be longer (for me it is now 50-70 seconds), but still much better!

Hope this helps someone, for some reason it worked for me.

This topic was automatically closed 24 hours after the last reply. New replies are no longer allowed.