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
- Copy BuildConfiguration.xml to
%appdata%\Unreal Engine\UnrealBuildTool\BuildConfiguration.xml
, or if your already have one:- add
<bPrintToolChainTimingInfo>true</bPrintToolChainTimingInfo>
to theBuildConfiguration
category - add
<CompilerVersion>Latest</CompilerVersion>
to theWindowsPlatform
category (or a toolchain >= to14.14.26316
) - disabling Unity build is recommended: add
<bUseUnityBuild>false</bUseUnityBuild>
to theBuildConfiguration
category
- add
- Build your solution (the output should be spammed with log)
- VS might crash because of that. If it happens, you can edit UBT to fix it (works even without a source build!):
- Open
Engine\Source\Programs\UnrealBuildTool\UnrealBuildTool.csproj
- Open
System\ParallelExecutor.cs
- Find the following line:
Log.TraceInformation("{0}", CompletedAction.LogLines[LineIdx]);
(should be around line 198) and replace it by
- Open
var Line = CompletedAction.LogLines[LineIdx];
if (Line.Contains(" error") || Line.Contains(" warning") || Line.Contains(" note"))
{
Log.TraceInformation("{0}", Line);
}
else
{
Log.TraceLog("{0}", Line);
}
-
- Rebuild the solution (will only rebuild UBT in a launcher build)
- Note: some errors/warnings might not be shown with this hack. You should change it back once you're done testing
- Once the build is finished, copy
Engine\Programs\UnrealBuildTool\Log.txt
next to main.py - Run main.py with python
- It'll create 3 csv: result_includes.csv, result_functions.csv, result_classes.csv. You can open those in wiztree
- 1MB = 1s
- Add the following arguments to the C/C++ Command Line option in your project settings:
/Bt+ /d2cgsummary /d1reportTime
- Add the following argument to the Linker Command Line option in your project settings:
/time+
- Rebuild your solution. The output should be spammed with log
- Find your build log file. For me it was under
MyProject/MyProject/Debug/MyProject.log
- Copy it next to the main.py and rename it to
Log.txt
- Run main.py with python
- It'll create 3 csv: result_includes.csv, result_functions.csv, result_classes.csv. You can open those in wiztree
- 1MB = 1s
- Follow same instructions as MSVC
- Run ly_filter.py on your Log.txt, provide an Ouput file.
- Run main.py on the new Output file.
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.