Build: each of the 478 AGC execution test objects parses the same header set again #10163
Loading…
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Imported from boykopovar/AnyPS5. Originally posted by LeandroLP23 on 2026-10-23T11:34:43Z.
The 478 AGC execution tests (
core/libs/prx/libSceAgcDriver/tests/execution/*.cpp, one executable each) spend most of their compile time parsing the same headers. 463 of the 478 sources includeVulkanTestDevice.hpp, which brings inVulkanDevice.hpp,Draw.hpp,Recompiler.hppand about 35 more project headers. So editing almost anylibSceAgcDriverheader recompiles all of them, and each one parses that set again.Measurement. Ryzen AI 7 350, Windows 11, WinLibs GCC 15.2, Release,
BUILD_TESTING=ON,maind339082d2e.Five sources taken at even intervals from the build's target list, each compiled alone with the exact command
ninjauses, on an idle machine:-fsyntax-only(parse only)-O3(the build)AddressPasses.cppDccKeysFirstWrite.cppFailedCaptureDump.cppImagePlaneCompareOnLine.cppPartiallyResidentSnapshot.cppParsing is 60 to 100% of each compile. Code generation is a small part, and
-O1is no faster.Where the time goes on a header edit. Touching
tests/execution/VulkanTestDevice.hppand rebuilding the execution test objects, with ccache disabled, at-j 4: 463 compiles, 664 s.Restructuring the includes doesn't fix it. I modelled the include graph of
core/and checked it againstninja -t deps: it gives 583 dependents ofState.hppwhere ninja reports 581. SupposeVulkanDevice.hpp,Driver/Driver.hpp,VulkanTestDevice.hpp,Resources.hppandShaderResources.hppall stopped including what leads to the Graphics headers. The translation units that recompile after an edit would still only drop 17 to 28%:State.hpp583 to 419,Texture.hpp558 to 427,Draw.hpp534 to 386. The tests include those headers themselves (Draw.hppdirectly from 373 sources), and making the five headers stop would touch hundreds of files many open PRs also edit. #10125 has the details.Proposal. One precompiled header shared by the execution tests. They are defined in a single loop with the same options, so the first one builds the PCH and the rest reuse it (
target_precompile_headers(... REUSE_FROM ...)). Its contents areVulkanTestDevice.hppand the five standard headers most of them include. It changes no source file. With ccache as the launcher, these targets also setCCACHE_SLOPPINESS=pch_defines,time_macros, which ccache requires to cache objects built with a PCH. Without it, every one of them would miss.#10164 implements it.
AI-assisted: yes (Claude Code)