Update two-stacks thresholds of promql function deriv() - #118987
Conversation
|
Workflow [PR], commit [46d27f5] Summary: ✅
AI ReviewSummaryThis PR lowers the two-stack selection thresholds used by the shared linear-regression time-series aggregators and updates the stateless/performance tests so they still exercise the intended recompute, average-density, and hard-cap paths. I did not find a code-level correctness or coverage problem in the implementation, but the PR template metadata does not describe the actual change accurately. PR Metadata
### Changelog category (leave one):
- Performance Improvement
### Changelog entry (a [user-readable short description](https://github.com/ClickHouse/ClickHouse/blob/master/docs/changelog_entry_guidelines.md) of the changes that goes into CHANGELOG.md):
Lowered the threshold that switches experimental `timeSeriesDerivToGrid` and `timeSeriesPredictLinearToGrid` from window recomputation to the two-stack sliding aggregator, improving finalize performance for windows with 4 to 11 populated buckets.Final Verdict✅ No technical blockers in the code or tests. Fix the PR metadata before merge. LLVM Coverage Report |
| /// capacity we stop trusting the average and bound the worst case: at this size a fully dense window already | ||
| /// makes recompute ~2x slower than two-stacks (measured by the `timeseries_to_grid_two_stack_vs_recompute` example). | ||
| static constexpr size_t BPW_TO_FORCE_TWO_STACKS = 20; | ||
| static constexpr size_t BPW_TO_FORCE_TWO_STACKS = 12; |
There was a problem hiding this comment.
Recent measurements after our optimizations showed different values than what were measured originally:
So these thresholds in the code should be updated
| <value>50</value> | ||
| <value>160</value> | ||
| <value>30</value> | ||
| <value>80</value> |
There was a problem hiding this comment.
Also the performance and stateless tests were adjusted to follow their claimed scenarios.
Build profile diff (arm_release)Comparing ✅ No significant changes. Binary sizes
The official master build is compiled with Compile time of recompiled translation units8 translation units recompiled, 45 s compile time in total, 8 of them have a recent master baseline. |
Changelog category (leave one):
Changelog entry (a user-readable short description of the changes that goes into CHANGELOG.md):
Update two-stacks thresholds of promql function
deriv()Workflow [PR]
Sync PR [sync-upstream/pr/118987]
Version info
26.9.1.1073(included in26.9and later)