Skip to content

[Tracking] BE build-time optimization: header-closure surgery, unity builds, and instantiation cuts #66715

Description

@morningman

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

  • [opt](build) Enable unity builds for the remaining BE targets #66789 — unity builds for the remaining targets (Cloud / Storage / Runtime / Load / IO / Util / …, -20.7% on top; the conversion also surfaced 4 latent bugs that get fixed on the way)
  • extern template declarations for the existing explicit instantiations (~-2% cold build, doris_be -47MB, cross-TU duplicate weak symbols -68%)
  • Decouple storage/olap_common.h from 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)
  • Small standalone: DORIS_DEV_DEBUG_INFO=line-tables developer 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.

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions