Build time takes too long (few minutes)

Few days ago I have conveted my project to 4.8 version (from 4.7.6). The build time with 4.7.6 (In VS C++) was about one or one and an half minute at the top. Usually it took 30 seconds. After I have convert the project to 4.8 the build time is very long. It takes a few minutes to build. Usually 180 seconds and 4-5 minutes sometimes. I can not work like that, it is very exhausts. I am pretty sure this is a bug because I can not see a legitimate reason for the code to compile so long.

I run the project on 64bits with DebugGame Editor on this settings:


I also have tried to uncheck the UE4 build radiobutton but it did not change anything.

Edit: I have just figured out why it takes so long. When I debug the code with VS when UE is closed the build time takes 20 seconds, but when it opens it takes few minutes. UE 4.8 takes too much resources from the computer. I can see that because the whole computer becomes slower. In 4.7 it did not happened.
My CPU is intel i5 3.3GHz

Hey -

Are you referring to building the solution file or packaging the project? Is there any affect on build time if you change the Platform for UE4 from Win32 to x64? Do you have the same compile time issues on a new project when code is added to it?

Cheers

Hey, I am referring to building the solution file. I have changed the platform for UE4 from win32 to x64 and it did nothing. I have opened new C++ project and built the code - it took 37 seconds. Although it is almost empty code project (TopDownExample), My project has alot of code and classes.

I am sorry but is is not possible, our project is commercial project and we can not send it to people. Is there another way to check it?

Hey -

As a project grows it will take longer to compile everything in the project. I have not noticed any significant difference in compiling a project for 4.7.6 vs 4.8.1 on my machine. If possible could you send me a copy of your project to test with?

Hey -

As the size of the game grows it will naturally take more time to compile everything. Here are a few ideas that may help to decrease compile time.

Remove unnecessary includes from .h files and/or move include statements to .cpp files

If File A includes File B and File B includes File C, then that means that File A will include File C even if it doesn’t use it.

 Remove the engine from the compile list

Rebuilding the engine should only be necessary if you’ve made changes to the engine’s code. If you only make changes to the game code then the engine does not need to be rebuilt when compiling code.

Cheers

Hey I have tried that and it did not work. I have just talked with my partners who also have the same project and they do not experience any long build time. This is means that the problem is not in the project or the code. As I have said my CPU is intel i5 3.3GHz and it is stronger than my partner’s CPU. I have tried to uninstall all of my UE versions (4.7.6 & 4.8) and the launcher and reinstall them again (this time only 4.8) and it did not do anything. This problem is very confusing, what else do you suggest to do?

Edit: I have just looked at my ram memory consumption in task manager:


Should there be so many processes of C++? and look at the memory consumption, it is huge and take all of my computer resources. This is why my computer become slower and it takes so much time to build the game. Do you know why it takes so much memory?

The C++ Package Server processes should not be related to your project solution or building process. It should be safe to manually close these processes. The Unreal Engine process looks like it may be normal usage. While the compile is running do you have a process with the description “Microsoft C/C++ Compiler Driver” and if so how much memory does it consume? This is the actual compiler running during the build process.

During build time:

Did you manually close the C++ Package Server processes? Did that help improve the compile time at all? Additionally you may want to close any other unnecessary processes that are running when trying to compile.

Unfortunately no, should I try reinstalling VS?

Hey -

I apologize for the delayed response. Reading back over the conversation it appears (based on the image from your original post) that you are building the entire UE4 engine when you compile your project. In the configuration manager you will want to uncheck box in the Build column for UE4. Then when you compile the project it should only compile the project itself rather than compiling the entire engine with it.

How do I get to that checkbox? Where is the Configuration Manager?

Hey mightyenigma-

The Configuration Manager can be found in the Build dropdown of the Visual Studio Toolbar.

Thanks! I was looking all over UE4 Editor.