Repository navigation
Build: a header edit in libSceAgcDriver recompiles 500 to 800 objects, mostly tests #10125
Replies: 2 comments
|
Follow-up after measuring further. Of the three options above, cutting includes pays off less than I expected. A model of the include graph matches What does pay off is how long each of those compiles takes. A typical execution test spends most of its compile parsing the same headers. One precompiled header shared by the execution tests halves their rebuild after a header edit: 664 s to 341 s at AI-assisted: yes (Claude Code) |
|
Closing: there was no answer on whether reducing these rebuilds is wanted, and the measurements are from AI-assisted: yes (Claude Code) |
Uh oh!
There was an error while loading. Please reload this page.
Editing almost any header of
libSceAgcDriveror the shader recompiler recompiles 500 to 800 objects. Most of them are test objects. I measured where that comes from and would like to know whether reducing it is wanted before anyone opens PRs, since every such change touches files many open PRs also touch.Measurement. Windows 11, WinLibs GCC 15.2, Release,
BUILD_TESTING=ON,maind339082d2e. Compile times come from.ninja_logof a full build at-j 4. The objects that depend on each header come fromninja -t deps. CPU minutes are the summed compile times of those objects.shader/recompiler/RuntimeAbi.hppGraphics/include/Context.hppGraphics/include/State.hppExecution/include/VulkanDevice.hppAt 16 jobs that is 7 to 9 minutes of wall time per header edit, and about 80% of it is tests.
Where it comes from.
Execution/include/VulkanDevice.hppincludesRecompiler.hpp,Draw.hpp,Recorder.hpp,Recipe.hpp,Presentation.hpp,DisplayBuffer.hpp,ComputePipelineCapture.hppandGuestAllocations.hpp. Through them it reaches 36 project headers. 382.cppfiles include it directly, and 378 of those are tests. In a static include graph ofcore/, it is the first include that bringsContext.hppandRecompiler.hppinto 373 translation units.Driver/Driver.hppis the next, with 74.What could change, smallest first:
VulkanDevice.hpp, so a header edit inGraphics/stops rebuilding them. This touches test files only, one test group per PR.VulkanDevice.hppforward-declares what its declarations only use by pointer or reference, and the.cppfiles that need more include it themselves.docs/dev/BUILD.mdgets a note that building a library target and the one test you need (ninja libSceAgcDriver agc_driver_<name>_tests) avoids most of this.tools/select_tests.pyalready does that in CI.Questions:
For a smaller and unrelated build cost, I opened #10124. It compiles
cmake/WindowsTestExit.cpponce instead of once per test executable: 1,223 times in a Windows configuration withBUILD_TESTING=ON.AI-assisted: yes (Claude Code)
All reactions