Compiling takes really long time

What SSD do you have and are your projects on the SSD, not just Unreal?
I understand that your CPU should be more than good enough for compiling.

I only put the system on the SSD, all programs are installed on regular hard drives

besides my hard drive is running and de fragmented when I compile it, I have checked

there is no reason why the compiler would be so slow…and I am a linux raspberry pi user, I know slow and huge c/c++ repository compilation

Just try to put your project on your SSD and check compile speeds. If you notice a difference, then you know the solution. Maybe it has something to do with all the code generation that Unreal does behind the scenes? Idk.

I can give it a try…even re-installing VS & Unreal on my SSD
thx for the help

May not want to do that idk. It would sure speed things up but you said you only had a 250GB SSD. Unreal, VS and your Unreal projects are going to eat that all up.

I agree, so get rid of intelisense and all that garabage and compile under 1 min for short stuff and under 3 min for long stuff.

You have a better computer than me so you should do better than me, these are my timings yours should be even better.

It’s visual studio, that is your problem I compile from the game engine, I do my work in notepad ++ with unreal bindings and fillings.

Run a build with Task Manager (or whatever equivalent for whatever system you’re using) open, and have a look at disk/ram/cpu usage. I can almost guarantee you’re disk I/O bound right now, and moving it to SSD will very rapidly move you to CPU bound. I had a similar system to what you have (though 4th gen i7), where system and all programs were installed on a small SSD from that era, and when I came back to Unreal after a few years away, I had Unreal building on my terabyte HDDs.

First I grabbed a 1TB SSD (they’re relatively cheap these days, highly recommend the upgrade even if you aren’t going to go with any further upgrades) and that greatly improved compiler perf, leaving me CPU bound during compiles. A full engine rebuild went from 12 hours down to about 6. My next move was to a new i7-10700 with 3x the RAM and a NVMe SSD. My full engine rebuild time went down to 45 minutes.

A complete game build/package for my project took well over a full day on my old PC, and now takes about 6 hours (of course, i try to avoid ever having to do that, and let the ThreadRipper systems at the office do those)

ok I 'll have a look…thx

I think this problem caused by hot reload of UBT. I was use compile button on unreal engine with hot reload, sometime it could just stuck and doesn’t compile anything.

But since I use a batch file to call UBT, it never happen anymore, the drawback is no hot reload, so restart the engine everytime compile C++.

Never use hot reload, it’s completely broken.

You should be running with debugger attached from your IDE, or using live coding for purely .cpp file changes.

could not pinpoint the issue…so far it’s compiling quiet fast

I wonder if the compiler tries to fetch a network resource or something

The problem is of course that unreal is the most unoptimised game engine out there.
It produces the most realism from these other game engines that are free, you can write C++ inside of it but it’s the worst on this other side of things.

They promised to fix this and they never did, I can spend from 5 seconds to minutes depending on the mood of the engine.

I looked what it is doing , why it is hanging this long minutes, and it’s not compiling the files but taking time in a place called “Shadow errors” to see if there are any shadows on the wall. So the short answer is, it’s chasing after shadows to see if there are any on the wall. Meaning it’s checking to see if there are doubles etc , duplicates and it takes minutes to check, after that I see it feeding the files and it takes like 30 secs after this.

After I compile multiple times and I get compiling done in around 30 secs, it starts hanging for minutes and I have to restart. The first time is also a tragedy, it takes minutes.

Here it is , spending minutes there, after that I see it feeds the header files it has with the files it needs to compile, when it gets to the file part , actually compling the files it does not take long.

So what why spend so much time there. Can’t we get rid of this.

  1. TRY RECOMPILING once in Visual Studio.
    I tried opening .sln file and in Visual Studio, tried clicking Debug button with dropdown options like (Development, DebugGame Editor) then clicked stop debub button. Closed everything. Opened just the project in UE editor. It was compiling fast enough.

  2. Did another change. The compiling messages suggested to update version 5_1 to 5_2 (I currently use 5.2) in ***.Target.cs

Open - ProjectFolder/Source/ProjectName.Target.cs
IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_2;

// Copyright Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
using System.Collections.Generic;

public class cp1EditorTarget : TargetRules
{
	public cp1EditorTarget( TargetInfo Target) : base(Target)
	{
		Type = TargetType.Editor;
		DefaultBuildSettings = BuildSettingsVersion.V2;
		IncludeOrderVersion = EngineIncludeOrderVersion.Unreal5_2; // updated this line. old value: EngineIncludeOrderVersion.Unreal5_1;
		ExtraModuleNames.Add("cp1");
	}
}

  1. Also, Visual Studio Integration tool was playing tricks, like it said it asked to install everytime, eventhough the launcher said it is already installed.
    So, checed the website, and opened Visual Studio Installer, and ticked the box for “Win 10 SDK 10.**.****” which was unselected (I use Win 10, but only Win 11 SDK was ticked)

Additional thoughts - Also someone can try to explain if it has to do something with : Intermediate\Build\Win64\x64\cp1Editor\DebugGame\Engine\SharedPCH.Engine.NonOptimized.ShadowErrors.h
which was created from scratch every time, and grew up to 1.5 GB of size. Logs.txt said this file was outdated.
This link says, the file’s timezone difference also counts. So, have to recompile when DST time changes every year.
Why are my PCHs out of date? | Andy Hippo (werat.dev)