What the experiments show
We test Buildray on real projects with fixed revisions and settings. These results do not predict performance on your machine.
Full builds: Unity on XGrammar
Each row uses three alternating pairs on the same runner, with all 83 C++ tests passing before and after.
| Jobs | Before → Unity | Faster |
|---|---|---|
| 1 | 172.46 → 136.32 s | 21% |
| 2 | 103.02 → 85.01 s | 17.5% |
| 4 | 67.08 → 56.36 s | 16% |
| 8 | 70.46 → 60.85 s | 13.6% |
Linux, Clang 21, Release, native tests enabled, Python bindings disabled. Levels 1/2 and 4/8 used separate four-CPU runners; eight jobs did not mean eight CPUs. Reports and independent verification.
Selected before/after measurements
Every row uses three alternating pairs, with full build and test validation. Compare values within a row; different rows may come from different runners.
| Project and experiment | Edited file | Before → after | Result |
|---|---|---|---|
| XGrammar, Unity | cpp/earley_parser.cc | 26.245 → 29.676 s | 13.07% slower |
| XGrammar, Unity | cpp/grammar_impl.h | 58.397 → 50.094 s | 14.22% faster |
| SentencePiece, PCH | src/sentencepiece_processor.cc | 3.933 → 3.257 s | 17.19% faster |
| SentencePiece, PCH | src/common.h | 50.036 → 51.494 s | Inconclusive |
| MuJoCo, PCH | src/user/user_model.cc | 227.502 → 227.547 s | Inconclusive |
Unity can speed up a header rebuild while slowing down a source rebuild. SentencePiece's PCH gain depends on reuse: editing common.h requires regenerating it. These MuJoCo experiments do not establish an overall PCH speedup.
The 18 scenarios, configurations and raw reports explain each result. Tested revisions are XGrammar 7e269d5, SentencePiece v0.2.2 e0cce7d and MuJoCo 651bae1. SentencePiece uses src/common.h on sentencepiece-static; this is separate from the older spm_test experiment.
Why linking deserves a closer look
One MuJoCo rebuild log contains 80 link steps. Compiling the edited source takes about five seconds, while the default build takes about 228 seconds. That warrants investigating what triggers those links and which are required. It does not prove that a particular dependency is unnecessary.
Both variants use the same setting to work around temporary dependencies emitted by gold with LTO. Without it, the build kept linking even without an edit, so Buildray refused incremental timings. The evidence records the setting and diagnosis.
Dependency cleanup so far
The grouped search removes 40 unused links in one trial on a test project, including library lists stored in CMake variables. A final check validates the combined patch.
| Project | What is validated |
|---|---|
| XGrammar | GoogleMock edit: 34.639 → 2.367 s, with all 83 tests passing. The parser edit stays inconclusive. The patch is already in draft #1005. |
| Highway | After merged #3502, another 84 link removals validate across 77 targets. A vqsort.cc edit measures 3.405 → 1.641 s, with 81 → 18 links, 2,784 passing tests and 23 unchanged skips. Draft #3509 keeps 83 test-library removals in 21 lines; its full test results are tracked there. |
| SentencePiece | Alias support exposes nine links across six executables. Every archive contributes code; no removal is proposed. |
| Snappy | The baseline passes. All six supported links contribute archive objects; no removal is proposed. |
| MuJoCo | 3,519 tests pass. On 236 eligible links, all 50 trial configurations are rejected. No patch or speedup is validated. |
The generic workflow also checked FlatBuffers (two CTest entries pass; no eligible link), Google Benchmark (18 removals and 87 passing tests; a benchmark_main.cc edit saves 0.29 s, too little for an upstream PR) and Draco (blocked because no CTest entries are registered).
The XGrammar gain concerns changes to GoogleMock, not a general clean-build speedup. The Highway timing comes from a revision after the first cleanup merged; targets.cc edits remain inconclusive. Pinned revisions, settings and raw results.
Limits of the evidence
Tests cover the supplied configuration. They do not replace validation on other platforms or of a library's consumers. Three pairs and a variation threshold are a screening method, not a statistical study.
A correct cleanup can be useful without a measurable speedup. We distinguish a validated patch from a recommended optimization. Next steps focus on work that can actually be avoided.