mirror of
https://github.com/optiscaler/OptiScaler.git
synced 2026-10-25 08:11:40 +00:00
This change more than doubles build speed for both clean and incremental builds. This could further improved by better managing pch.h contents and separating dependency compilation. - Debug clean build: 75s to 32s (~2.3× faster) - Debug incremental: 8s to 4s (2.0× faster) - Release clean build: 84s to 38s (~2.2× faster) - Release incremental: 40s to 18s (~2.2× faster) Problems with previous setup: - pch.h was misused as a general-purpose utility header and included from other headers. - Precompiled headers were never actually enabled in the build configuration. - Including a putative PCH from other headers violates two fundamental requirements: 1. A PCH must be the first #include in a translation unit to be effective. 2. Including PCH candidates in other headers defeats the optimization and triggers excessive rebuilds. Changes: - Relocated global utility declarations from pch.h to new SysUtils.h - Replaced all #include "pch.h" occurrences in header files with #include "SysUtils.h" - Headers no longer include pch.h under any circumstances - Enabled /Yc (Create PCH) on pch.cpp and /Yu (Use PCH) on remaining .cpp files - Excluded ImGui build from precompiled headers. Ideally this should be compiled as a separate, statically linked dependency, but this is a problem for another time. - Added #include "pch.h" as the **very first** non-comment line in all .cpp translation units
1 line
16 B
C++
1 line
16 B
C++
#include "pch.h" |