Skip to content

bench: add window aggregate filter benchmarks - #24589

Open
lyne7-sc wants to merge 3 commits into
apache:mainfrom
lyne7-sc:bench/window-filter
Open

bench: add window aggregate filter benchmarks#24589
lyne7-sc wants to merge 3 commits into
apache:mainfrom
lyne7-sc:bench/window-filter

Conversation

@lyne7-sc

Copy link
Copy Markdown
Contributor

Which issue does this PR close?

Rationale for this change

Add benchmark coverage for evaluating the performance impact of the window aggregate filter argument evaluation changes in #24508.

What changes are included in this PR?

Adds a Criterion benchmark for window aggregates with FILTER over pre-ordered input.

It covers:

  • Cumulative and sliding frames through BoundedWindowAggExec.
  • Whole-partition frames through WindowAggExec.
  • Column, division, and power arguments.
  • Different representative FILTER selectivities.

This PR only adds benchmark coverage and does not change behavior.

Are these changes tested?

Yes.

Are there any user-facing changes?

No.

@github-actions github-actions Bot added the physical-plan Changes to the physical-plan crate label Aug 23, 2026
@codecov-commenter

codecov-commenter commented Aug 23, 2026

Copy link
Copy Markdown

Codecov Report

✅ All modified and coverable lines are covered by tests.
✅ Project coverage is 81.43%. Comparing base (dbdc627) to head (9425746).
⚠️ Report is 59 commits behind head on main.

Additional details and impacted files
@@            Coverage Diff             @@
##             main   #24589      +/-   ##
==========================================
+ Coverage   81.31%   81.43%   +0.12%     
==========================================
  Files        1117     1118       +1     
  Lines      395911   399550    +3639     
  Branches   395911   399550    +3639     
==========================================
+ Hits       321918   325376    +3458     
+ Misses      55177    55172       -5     
- Partials    18816    19002     +186     

☔ View full report in Codecov by Harness.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.
  • 📦 JS Bundle Analysis: Save yourself from yourself by tracking and limiting bundle sizes in JS merges.

@neilconway
neilconway self-requested a review August 23, 2026 09:12

@kumarUjjawal kumarUjjawal left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thank you @lyne7-sc for working on this.

Overall looks good, I had two questions which I mentioned. Please take a look.

argument_kinds: &[ArgumentKind],
filter_percents: &[usize],
) {
let mut group = c.benchmark_group(format!("window_aggregate_filter/{name}"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

bounded_window sets sample_size(10) on its group, should we set it here too, per group so the microsecond-scale whole-partition cases can keep a higher count?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks. I've reduced the sample size to 10.

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I had in mind was setting this per group: 10 for the millisecond-scale bounded frames, and leaving whole-partition at the default.

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Updated. the bounded groups use a sample size of 10, while the whole-partition group uses default of 100.

&[ArgumentKind::Column, ArgumentKind::Power],
&[30],
);
benchmark_window_case(

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A whole-partition frame is constant in partition and does a single update_batch, while the cumulative and sliding frames walk row by row and spend their time in range calculation rather than argument evaluation. Would it be worth giving this group all three argument kinds and all three selectivities and trimming the cumulative group back?

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks for the suggestion. I think this is a reasonable balance. I've updated the benchmark coverage.

argument_kinds: &[ArgumentKind],
filter_percents: &[usize],
) {
let mut group = c.benchmark_group(format!("window_aggregate_filter/{name}"));

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What I had in mind was setting this per group: 10 for the millisecond-scale bounded frames, and leaving whole-partition at the default.

Comment on lines +229 to +230
&[ArgumentKind::Column, ArgumentKind::Power],
&[30],

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could we restore divide here, and the 10 and 50 percent points with it?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

physical-plan Changes to the physical-plan crate

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants