Compilation takes ages to complete

When I compile my project in Visual Studio it takes ages to complete (well, not ages, just 5 minutes). Does anyone have an idea why this takes so long? My project only has 3 classes, all this time it’s not because it is compiling the code that’s for sure.
Probably running some tool to update some data on UE.
It pauses here:

2>Using Visual Studio 2019 14.27.29111 toolchain (C:\Program Files (x86)\Microsoft Visual Studio\2019\Community\VC\Tools\MSVC\14.27.29110) and Windows 10.0.19041.0 SDK (D:\Program Files (x86)\Windows Kits\10).
2>Building 9 actions with 8 processes…

Anything I can do to speed up this?

It’s from Visual Studio, it’s ■■■■.
It’s the intelisense garbage stored in the DB that is causing you problems.

They made this database that stores information there to rethink things, go thru them (Cycle over and over) on some objects of your code, when the compiler is not sure so there are no header errors for the compiler.

Intelisense is causing you this problems by making recursions on your code over and over, and the compilation time increases, it pulls from this database things to compare stuff for the header, and if it thinks it needs to check again then it will check again and again in a recursive patern.

Not only that but this data base stores information that go’s who know’s where, people were complaining that this DB killed their hard drive, ate all the free space. Now when you run your program again and make changes it will look inside this database and compare things.

This whole thing “they say” is for the headers not to make errors and compile the code in a correct manner, so it needs to make recursions, to double check. I doubt it, I think it’s to collect information from people who they think they are "WORTHY :grinning: ) to see what they are up to.

So just compile manual from command prompt without visual studio running and see the time.
You can compile your UE project manually without VS either by command prompt or going into the editor and simply hitting compile, this should give you an idea to see if it’s intelisense problem.

I use either the editor inside unreal, or NotePad ++ and sometimes after the first compilation it takes 30 or more seconds or so if my resources are availible and I close down everything, browser and so on.

Go to your hard drive click and open task manager , then open up resource monitor in task manager, go to disk activity and while it’s compiling see what is writing to disk.

If you see something labled with DB that tops disk activity then that is your problem
You will see the processes in Disk activity and know where your problem is anyway, it shows what active files are writing to and reading to and if there are recursions.

I’m afraid it isn’t an intellisense problem.
I’ve made the following test:

I’ve close VS and executed the build command from a command prompt and the problem persisted.
This command (I’ve taken it from the VS project configuration)
(…)\Epic Games\UE_5.0EA\Engine\Build\BatchFiles\Build.bat" FatKnightEditor Win64 Development -Project=“FatKnight.uproject” -WaitMutex -FromMsBuild
It hanged.
While it was hanging, UE Editor was the process that was taking most CPU at around 3%.

Then I closed the UE Editor, and voila, it compiled fast.
I opened VS, and recompiled. Fast!!
Reopened the UE Editor, executed the batch file. Fast!
Recompiled in VS. Fast!

I’m like: what the…is going on here?

Maybe you should reinstall the build tools without visual studio.

I’m not sure, but when you install the build tools with Visual Studio or better said thru Visual Studio maybe unreal configures it that way, to run thru the Visual Studio setup and has a configuration.

Just uninstall Visual Studio, go to the build tools repository for C++ on the microsoft site and check there to install without Visual Studio the tools in a manual way. This way you don’t have to reinstall Unreal unless you are 100% sure it’s unreal.

I had the same problem as you with Visual Studio Code, it was taking forever to do anything, it turned out to be intelisense. So what I did I uninstalled anything that has to do with C++ and re-installed just the Microsoft C++ Build and Compile tools without Visual Studio.

Went then in Unreal and compiled and it worked without any lag or delay.

So the idea is that your setup may be rooted thru Visual Studio in the editor, configured to use Visual Studio while you are compiling from the editor.

If it’s not this then it must be some config file in the editor /game engine files that is “Upset” I herd people talk about this, but they said they modified things in there and it was giving them strange behaviours. But they tampered with different config files, it did not happen out of the blue.

I found the old files pictures when I had problems.

You see how it’s repeating it’s self, how the header calls repetitions if intelisense go’s bad, because it build up this huge DB, you can see the repetition calls by the header in red , and the DB as consuming more ram in blue at the top of disk activity. Browse.VC.DB where it takes from the DB and calls on the header to repeat over and over.

But maybe you don’t have the same problem, this is one of the problems anyway causing the compiler to hang and take a long time