Speed up Unreal Engine projects recompilation with octobuild
Long compilation time is one of the major pain points of C++. Unreal Engine isn’t getting any smaller with every update. In fact, the number of compilation targets has doubled in the last several years! Long developer iteration time hinders the project’s progress and affects the ability to concentrate.
Even more, when working in a team, you often need to switch between branches of code many times a day. Every branch switch costs precious time.
Many of the go-to ways to speed up compilation are already employed in Unreal Engine: precompiled headers, optimized include usages aka Include What You Use, parallel compilation, unity builds, and modules, to name a few. However, there’s one more way to improve the speed even more: compiler cache.
Use octobuild
Today I would like to tell you about Marat Radchenko’s octobuild. Octobuild works by caching intermediate compilation files, allowing Unreal Engine to simply read the files from disk cache instead of fully recompiling the files the second time you need them. It allows superfast branch switching and almost effortless engine recompilation. Benchmarks show the reduction of compilation times by 60% to 90%.
With octobuild there’s no more hesitation in experimenting with the engine; switching to a teammate’s branch just to check out the blueprints is a breeze. I cannot recommend octobuild enough as it has saved me tens of hours (and counting) already!
The setup is easy: you just install octobuild from a package manager (or build it from source) and that’s it. octobuild hooks up to the Unreal Engine build system by the means of xgConsole
Incredibuild’y executable and starts caching compilation modules right away.