linrrzqqq opened a new pull request, #69717:
URL: https://github.com/apache/doris/pull/69717
### What problem does this PR solve?
Several shared BE headers transitively include protobuf, Thrift,
thread-pool, and storage-reader implementations. Translation units that only
need declarations must still parse these definitions, increasing compilation
work and the rebuild scope when those headers change.
Recent CI builds failed during CMake configuration because the reverse-reach
counts for threadpool.h and rle_encoding.h exceeded the build-hygiene limits.
This PR audits all 32 header-budget entries and reduces unnecessary
dependencies without changing the budgets or exception lists.
The changes:
- Extract ColumnIteratorOptions into a dedicated header so vexpr_context.h
does not require the full column_reader.h dependency chain.
- Use forward declarations for thread-pool, protobuf, cache, and
WorkloadGroup types where complete definitions are unnecessary.
- Move UniqueId conversions, protobuf methods in numeric SerDe, and selected
construction/destruction operations into .cpp files.
- Extract SyncSizeCallback into a dedicated header to reduce RPC
dependencies propagated through the runtime-filter interface.
- Add direct includes at actual use sites and verify independent compilation.
Object layouts, move semantics, explicit template instantiations, and
per-value decoding implementations are preserved. Moving some definitions into
.cpp files changes their visibility for inlining in ordinary separate
compilation. Query runtime performance has not been measured in this PR.
### Dependency reductions
The following counts come from Ninja dependencies after completed builds,
covering 1,531 production translation units and 52 generated translation units:
| Header | TUs before | TUs after | Reduction |
|---|---:|---:|---:|
| util/rle_encoding.h | 537 | 154 | 71.32% |
| util/threadpool.h | 607 | 361 | 40.53% |
| gen_cpp/types.pb.h | 1,064 | 901 | 15.32% |
| gen_cpp/segment_v2.pb.h | 808 | 748 | 7.43% |
| gen_cpp/internal_service.pb.h | 445 | 357 | 19.78% |
| gen_cpp/FrontendService_types.h | 474 | 357 | 24.68% |
| gen_cpp/cloud.pb.h | 197 | 51 | 74.11% |
| gen_cpp/BackendService_types.h | 220 | 178 | 19.09% |
| gen_cpp/data.pb.h | 467 | 383 | 17.99% |
| storage/options.h | 253 | 150 | 40.71% |
| io/fs/s3_file_system.h | 56 | 15 | 73.21% |
Across the 16 monitored heavy headers, measured header-to-TU dependency
pairs decrease from 8,108 to 6,617, an 18.39% reduction. These removals affect
742 distinct translation units. The number of production compilation units
remains unchanged.
The transitive project-header closure of dependency.h decreases from 325 to
246 headers, a 24.31% reduction. This uses the hygiene script’s static include
graph and is reported separately from the measured Ninja dependency counts.
### Release note
None
### Check List (For Author)
- Test: Three complete Release builds; standard ASAN BE/FE build and final
incremental build; all BE UT sources compiled and linked; 29 selected unit
tests passed with -j50 --coverage; 1,024-row service read, aggregate, shuffle
join, sort and cast checks; header hygiene and changed-line format checks
passed. Clang-tidy covered all 71 files and retained two existing warnings in
relocated protobuf methods (function size and signedness).
- Behavior changed: No
- Does this need documentation: No
### What problem does this PR solve?
Issue Number: close #xxx
Related PR: #xxx
Problem Summary:
### Release note
None
### Check List (For Author)
- Test <!-- At least one of them must be included. -->
- [ ] Regression test
- [ ] Unit Test
- [ ] Manual test (add detailed scripts or steps below)
- [ ] No need to test or manual test. Explain why:
- [ ] This is a refactor/code format and no logic has been changed.
- [ ] Previous test can cover this change.
- [ ] No code files have been changed.
- [ ] Other reason <!-- Add your reason? -->
- Behavior changed:
- [ ] No.
- [ ] Yes. <!-- Explain the behavior change -->
- Does this need documentation?
- [ ] No.
- [ ] Yes. <!-- Add document PR link here. eg:
https://github.com/apache/doris-website/pull/1214 -->
### Check List (For Reviewer who merge this PR)
- [ ] Confirm the release note
- [ ] Confirm test cases
- [ ] Confirm document
- [ ] Add branch pick label <!-- Add branch pick label that this PR should
merge into -->
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]