Description
Umbrella issue for the BE build-time optimization series: make a cold BE build several times faster and shrink the incremental rebuild radius of the hottest headers, with zero runtime behavior change.
The batch was developed and measured on one branch and published as the combined reference PR #66510, which stays open as the whole-batch reference carrying the end-to-end measurements. It is being landed as the focused PR series below; the split PRs supersede it.
Headline numbers
PR series
Landed
In review
Planned — numbers measured on the combined branch, to be re-validated in each PR
How each PR is written
Every PR body carries its own measured numbers with the measurement conditions (-j level, PCH on/off, paired runs), its verification evidence (no-PCH closure sweep over all TUs, incremental rebuilds, BE UT, regression/microbenchmarks where semantics are touched), and a disclosure section for negative results and known blind spots — e.g. all local measurements are macOS/clang20, so Linux gcc/clang coverage relies on the PR CI lines.
Description
Umbrella issue for the BE build-time optimization series: make a cold BE build several times faster and shrink the incremental rebuild radius of the hottest headers, with zero runtime behavior change.
The batch was developed and measured on one branch and published as the combined reference PR #66510, which stays open as the whole-batch reference carrying the end-to-end measurements. It is being landed as the focused PR series below; the split PRs supersede it.
Headline numbers
./build.sh --compile-bench -j 6on the same idle machine (details in [opt](build) 2/4: Halve the BE cold build (21m45s -> 11m10s, -48.7%) via unity builds, instantiation cuts and header-closure surgery #66510): 21m45s → 11m10s (-48.7%) end-to-end, sum of per-TU wall -51.3%, compile units 8380 → 7281.storage/olap_common.hrebuilds all 318 first-party TUs (through the PCH) plus the 219MB PCH itself; after the final PR in the series it rebuilds 182, and the PCH depends on 9 doris headers instead of 31.PR series
Landed
exec_env.h/runtime_state.h/thread_context.h(~-22% cold build)-fno-access-controlnever actually reachingdoris_be_teston any platformclosure-sweep.sh --no-pch,rebuild_radius.py,tu-bench.sh): the measurement gate the rest of the series points atcolumn.h, RLE decoders, pipelinedependency.h), same seed-then-cut shape as [opt](build) 1/4: Speed up BE full build ~22% by cutting hot-header include edges #66400ENABLE_UNITY_BUILD(default ON) and pilot unity builds on three glue targets (-11.8% end-to-end at -j14; information_schema segment 13×, http 10.4×)In review
Planned — numbers measured on the combined branch, to be re-validated in each PR
extern templatedeclarations for the existing explicit instantiations (~-2% cold build,doris_be-47MB, cross-TU duplicate weak symbols -68%)storage/olap_common.hfrom the bottom of the include graph and slim the PCH — the incremental-rebuild-radius PR (318 → 182 dependents; PCH trigger line 31 → 9 doris headers)DORIS_DEV_DEBUG_INFO=line-tablesdeveloper knob (-10.8% per TU for local debug builds; default output bit-identical)How each PR is written
Every PR body carries its own measured numbers with the measurement conditions (-j level, PCH on/off, paired runs), its verification evidence (no-PCH closure sweep over all TUs, incremental rebuilds, BE UT, regression/microbenchmarks where semantics are touched), and a disclosure section for negative results and known blind spots — e.g. all local measurements are macOS/clang20, so Linux gcc/clang coverage relies on the PR CI lines.