Repository navigation
Visit only updated inputs while IMergingTransformBase waits for first chunks - #131683
Conversation
…st chunks
Until every input delivers its first chunk, `prepare` rescanned all inputs on
each call, so starting a merge of N inputs cost O(N^2). Override the `prepare`
overload that receives the updated input ports: the first call still visits
every input, later calls visit only the updated ones, found by binary search in
a vector of ports sorted by address (one allocation per transform).
Time spent in the transform's `prepare` until the merge finishes, one-row
inputs, master -> patched:
N = 2: 0.6 us -> 0.6 us
N = 16: 6.9 us -> 3.8 us
N = 256: 1.06 ms -> 64 us
N = 10000: 1.57 s -> 2.9 ms
In-order read of a 10k-part table, max_threads = 1: 1.34 s -> 0.48 s;
with parallel replicas and max_threads = 4: 0.95 s -> 0.44 s.
Co-Authored-By: Claude Opus 5.5 <[email protected]>
|
Workflow [PR], commit [438409b] Summary: ✅
AI ReviewSummaryThe PR makes startup of Missing context / blind spots
Final VerdictStatus: ✅ Approve. |
The existing `read_in_order_many_parts` stops at 1000 parts, where the quadratic startup of `IMergingTransformBase` is within the noise. Idle 192-vCPU box, master -> patched: fill 1.3 s in both; max_threads = 1: 1.26-1.33 s -> 0.45-0.48 s; max_threads = 4: 0.55 s -> 0.29-0.35 s. Co-Authored-By: Claude Opus 5.5 <[email protected]>
…orts' into merging-transform-init-updated-ports
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Object file sizes24 object files changed (+24.76 KiB total), 0 added.
711 more object files are built by the master warmup baseline only (it builds every object-file target, a pull request build only Compile time of recompiled translation units43 translation units recompiled, 466 s compile time in total, 43 of them have a recent master baseline. Median compile-time ratio to the baselines is ×0.95 (machine-speed difference or a change affecting every TU); per-TU deltas below are relative to that ratio. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Faster pipeline startup for merging transforms with many inputs, e.g. reading in order from tables with many parts.
Until every input of a merging transform delivered its first chunk,
IMergingTransformBase::preparerescanned all inputs on each call, so starting a merge of N inputs cost O(N^2). The transform now overrides theprepareoverload that receives the updated input ports. The first call still visits every input; later calls visit only the updated ones. A port is found by binary search in a vector of ports sorted by address, which costs one allocation per transform.Time spent in the transform's
prepareuntil the merge finishes, one-row inputs, single-threaded executor, master → patched:In-order read of a 10k-part table:
max_threads = 1: 1.34 s → 0.48 s.max_threads = 4: 0.95 s → 0.44 s.Workflow [PR]
Sync PR [sync-upstream/pr/131683]
Version info
26.11.1.2464-master(included in26.11and later)