Files
datastore/programs
5c5ceac759 Replace heavy StorageReplicatedMergeTree.h include with targeted MergeTreeBackgroundExecutor.h in Server.cpp
`Server.cpp` included `StorageReplicatedMergeTree.h` but never used the
`StorageReplicatedMergeTree` class directly. The only dependency was on
`MergeTreeBackgroundExecutor` for thread pool management (accessed via
`Context::getMergeMutateExecutor` etc.).

`StorageReplicatedMergeTree.h` is an extremely heavy header that
transitively pulls in `MergeTreeData.h`, `SortCursor.h` (with expensive
`std::variant` instantiations for sorting queues), `MergeTask.h`,
`MergeFromLogEntryTask.h`, `TextIndexUtils.h`, and `DataPartsExchange.h`.
The time trace showed 3.9s just for parsing `StorageReplicatedMergeTree.h`
plus ~4.3s of template instantiations from `SortCursor.h` variant types.

Replacing it with the targeted `MergeTreeBackgroundExecutor.h` reduces
`Server.cpp.o` compile time from 34.8s to 28.1s (-19%). Since `Server.cpp`
is on the critical path (last .o file to finish before linking), this
directly reduces wall time.

Build time: 5m6.0s (was 5m16.7s, -10.7s / -3.4%)

Co-Authored-By: Claude Opus 4.6 <[email protected]>
2026-02-24 18:20:20 +01:00
..
2026-02-08 00:14:02 +01:00
2026-01-12 12:27:55 +01:00