Slow C++ compile time for trivial changes (hot reload)
Hello everyone! I'm experiencing very long compilation time for my C++ code. I'm doing the C++ battery collector tutorial, therefore my code base is small (a few short classes).
Few examples: Recompiling without doing any changes takes ~2 minutes. I've added a few lines of code to one class (and only one class) and it took 5 minutes. In the video, the same changes took only a few seconds to compile.
Such slow compile times make it impossible to work.
Looking at the Resource Manager, I can tell that my hard disk is the bottleneck. Another thing I noticed is that in the output log it prints: " Added 2393 classes and 506 folders" when I only changed one class! Is it possible that it recompiles the entire engine every time I compile?
How can I fix this?
Thanks in advance!
EDIT: I'm using Visual Studio 2017 Community, UE4.17.2 and Windows 10.
Unfortunately the best step really is better computer hardware. Putting all of Unreal on an SSD will certainly help, the launcher, your project, maybe even Visual Studios, etc. This makes the disk access much faster, but it won't solve it for sure.
One thing that has been recommended in the past is to open your
The default settings in Unreal tend to be tweaked for massive AAA projects and these have been reported in the past as ways to help with that.
As far as the Output Log saying:
In general, I've found that using Hot Reload in combination with creating blueprints based off of the hot reloaded code tends to be a bad idea. If you're just changing the implementation inside a cpp file then things go pretty well. However, if you modify things in the header (change function signatures, add new variables, etc.) and then create a blueprint derived from the class you can run into weird issues when you go to reload the blueprint the next time after doing a non-hot reload compile. This is because when you hot reload and change data structures it appears to make "HOTRELOAD_" versions of stuff that you'll occasionally see pop-up in Blueprints when trying to use data related to the hot reloaded code. It's at this point that I shut down the editor and do a full compile as using the HOTRELOAD_* versions of things in the Blueprints tends to cause issues.
answered Oct 21 '17 at 05:13 PM
Well, this game programming isn't a joke you can get by with a decent computer. But to be ultimate I say you need a computer the price of a house. A solution is to just "write a ton of code" or more then a line at a time when you compile.
I have same issue. for me it's impossible to do c++ coding. default c++ fps template. changeling single variable value leads to 5+ minutes in compilation. it's like whole days wasted
need a solution for it asap.
answered Dec 15 '18 at 03:10 PM
Bump, same with me. really powerful computer but slow compile times. I have compiled a project on my PC without using unreal and then compiled the same project using unreal. Unreal typically takes 10 times longer. Half the time is spent pre-compile(unreal header and reflection stuff?), and then half is compile. Why is unreal so much slower? Would love more advise on how to speed up unreal compile times.
Follow this question
Once you sign in you will be able to subscribe for any updates here