Extremely slow compiling

For no particular obvious reason, my compiling takes a VERY long time.

Initial compile takes roughly 1.5 hours, okay, that’s long, but understandable. However, hot reloading a game module, which is basically the Blank C++ template with a single extra file, which has nothing more but a Test() method in it which prints to the screen, takes 3 minutes, if I change the string alone!

I have an Intel i7 950, which is clocks at 2.8, but overclocks to 3.4. I have 6GB of RAM and speed of my HDD is okay (I have yet to try putting UE4 on my SSD, but I doubt fragmentation and whatnot on the current drive actually causes this).

You could say my system is somewhat mediocre, and I would agree, however, during the initial engine compilation I have been watching my resources and noticed my CPU/RAM RARELY reach their limits, CPU seems to idle more than it does anything when cl.exe is running (link.exe actually makes it spin up), the output seems to hang on Module.*.cpp files a lot for extended periods (5 minutes), while the system seemingly isn’t doing anything useful, as if it’s waiting. In most cases, the light of the HDD aren’t even blinking. (Using Visual Studio 2012, by the way, I also disabled my AV and FW for this, to make sure they don’t interfere).

This is a very weird issue and I would like to figure out the cause of this. Is there someone with similar specs, what are your results?

Log of the compile that just finished:

2>  -------- End Detailed Actions Stats -----------------------------------------------------------
2>  Cumulative action seconds (8 processors): 0,00 building projects, 17339,22 compiling, 0,00 creating app bundles, 0,00 generating debug info, 4196,52 linking, 0,00 other
2>  UBT execution time: 5510,00 seconds

Same issue here. I do understand that an initial build takes longer, yet as Lennard puts it - why should subsequent tiny changes take also soooooo long to build.

I tried several of the suggested fixes from the answerhub and using /Yu build flag to have the compiler generate/use pre compiled headers, but it didn’t quite help, still slow.

Plus the IntelliSense thing isn’t working properly either. I rarely get any help from it and when I do it was after waiting for a couple of minutes in the 5+ region.

I’m using VS2013 in Win8.1 on a i7-740MQ with 8GB

At first glance, my advice would be to move everything Unreal-related to your SSD and upgrade to 16GB of RAM (both of these will make an enormous difference), but just to eliminate any potential source of error, can you verify that your project’s Build.cs file

(ie C:\Users\UserName\Documents\Unreal Projects\ProjectName\Source\ProjectName\ProjectName.Build.cs )

looks something like this:

// Copyright 1998-2014 Epic Games, Inc. All Rights Reserved.

using UnrealBuildTool;
    
public class ProjectName : ModuleRules
{
	public ProjectName(TargetInfo Target)
	{
        MinFilesUsingPrecompiledHeaderOverride = 1;
        bFasterWithoutUnity = true;
		PublicDependencyModuleNames.AddRange(new string[] { "Core", "CoreUObject", "Engine", "InputCore" });
	}
}

Mostly I ask because I was also seeing 2-3 minute hot reload compilation times prior to making this change.

Assuming this, but otherwise following the standard setup instructions (and testing hot reload by following the Intro to Programming Tutorial exactly: Introduction to Programming | Live Training | Unreal Engine - YouTube ), here’s what I’m looking at in terms of specs/compilation time:

Setup #1:

  • Self-assembled PC Tower
  • Core i7-3770K @ standard clock (3.5/3.9),
  • 16GB DDR3 @ 2400MHz,
  • Crucial C300 128GB SSD,
  • Windows 7 SP1, Visual Studio 2013 Pro

Typical first compilation time: 19-22 minutes (based on 6 compilations)

Typical hot reload compilation time for a trivial change: 5-7 seconds

Setup #2:

  • MacBook Pro Retina (15-inch, Early 2013)
  • Core i7 @ 2.4GHz,
  • 8GB DDR3 @ 1600MHz,
  • (Stock) 256GB SSD,
  • OSX 10.9.2, XCode 5.1

First compilation time: ~35 minutes

Typical hot reload compilation time for a trivial change: 20-25 seconds

Hope this helps and good luck!

I moved everything to my SSD, and I magically got the times everybody mentions: initial compile less than 25 minutes, hot recompile ranging from 10 to 30 seconds. It’s probably worth investing in a SSD which I can devote to data, as my current SSD is OS-only and too small to contain Unreal on top of that.

The “faster recompile trick”, however, doesn’t do a lot for me. It doesnt matter whether I put it in the ModuleRules or not, compile always takes between 10 to 30 seconds.

He Ryvar, thanks for your answer. Those changes did do something…Game related project now compiles on itself in under 10 sec :smiley:

I’m currently in the process of setting up my new laptop - since it’s like 4 generations newer it should give plenty of boost there.

Thanks again! :slight_smile:

Ruben