Download

C++ Compile Times Visualizer

I made a tool to show where the compiler is spending time in a nice graphical way. It works by parsing the msvc output log & sending the result to wiztree for visualization.
A side effect of using a disk usage tool for that is that times are in MB instead of seconds (1B = 1 micro second), so don’t be confused by that.

This is useful if you want to:

  • Clean up your includes
  • Find which functions takes time to compile
  • Find which symbols are included in which files
  • Speed up your compilation!

Using it I went from 240s to 170s for a full recompile of my plugin in debug mode :slight_smile:

Source: GitHub - Phyronnaz/UECompileTimesVisualizer: Debug compile times in Unreal Engine & MSVC projects

Includes

See which headers are included by your files, and how long they take to compile. Surprisingly the file itself is often a really small portion of the total compile time. Can help you decide if it’s worth moving the functions definitions to a cpp.

https://camo.githubusercontent.com/ac8a9c12b278f4da4f995bd4abcca6fc6aa92e78/68747470733a2f2f692e696d6775722e636f6d2f5874484c365a652e706e67

Classes

See which classes are compiled in your files, and how long it took. Here too the compiler is probably spending most of its time compiling classes from included headers.

https://camo.githubusercontent.com/8b8e143ccafa27aab3545667352cf6e831d64f69/68747470733a2f2f692e696d6775722e636f6d2f6f506a614d70742e706e67

Functions

See which functions are compiled in your files, and how long it took. Can help determining which function to put between PRAGMA_DISABLE_OPTIMIZATION / PRAGMA_ENABLE_OPTIMIZATION

https://camo.githubusercontent.com/942db099fb69583f2766cb1646999ee3172fe63e/68747470733a2f2f692e696d6775722e636f6d2f4943727450664a2e706e67

This is awesome! Great work, we’ve shaved off like a minute or two already.

Hi, I’m trying to use your tool in a project using Unreal 4.20.1, but when I pass the log file to main.py, I simply see thousands of “Skipping line” messages going past the screen. Looking at the python code, your script expects to find square brackets in the log, but I don’t see any in the one generated by Unreal. Which version of Unreal are you using? And which lines is your tool looking for? Maybe I can patch the script to make it work with my version of Unreal.