In recent Unreal Engine versions, you should be able to just set bPrintToolChainTimingInfo
to true in your BuildConfiguration.xml (see below).
You can then compile Engine\Source\Programs\Windows\CompileTimeAnalyzer and use it to load the .timing files located in your Intermediate folder.
The Compile Score VS extension also works great with Unreal if you want to see how much you're spending including files: https://marketplace.visualstudio.com/items?itemName=RamonViladomat.CompileScore2022
Note: as this is using a disk visualizer as output, the following convention is used:
1MB = 1s | 1B = 1 micro second
It's a frontend for the msvc timing output log. With it you'll be able to see which function takes time to compile, which headers are included by your files and how expensive they are...
Basically if you want to speed up your compilation in UE or in a project using MSVC this should help a lot :)
MSVC dev team blog post about compiler speed
Aras P. blog post about compile times
%appdata%\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml
, or if your already have one:
<bPrintToolChainTimingInfo>true</bPrintToolChainTimingInfo>
to the BuildConfiguration
category<CompilerVersion>Latest</CompilerVersion>
to the WindowsPlatform
category (or a toolchain >= to 14.14.26316
)<bUseUnityBuild>false</bUseUnityBuild>
to the BuildConfiguration
categoryEngine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj
System\ParallelExecutor.cs
Log.TraceInformation("{0}", CompletedAction.LogLines[LineIdx]);
(should be around line 198) and replace it by
var Line = CompletedAction.LogLines[LineIdx];
if (Line.Contains(" error") || Line.Contains(" warning") || Line.Contains(" note"))
{
Log.TraceInformation("{0}", Line);
}
else
{
Log.TraceLog("{0}", Line);
}
Engine\Programs\UnrealBuildTool\Log.txt
next to main.py/Bt+ /d2cgsummary /d1reportTime
/time+
MyProject/MyProject/Debug/MyProject.log
Log.txt
First arg: log file, defaults to Log.txt
Second arg: destination, defaults to result
The script will print the headers and the number of times they were included. This can be used to decide which headers should go in a PCH.
See which headers are included by your files, and how long they took to include.
See which classes are compiled in your files, and how long it took.
See which functions are compiled in your files, and how long it took.