ESQL: GroupedTopNOperator benchmark#144003
Conversation
# Conflicts: # test/framework/src/main/java/org/elasticsearch/common/util/MockBigArrays.java # x-pack/plugin/esql/compute/src/test/java/org/elasticsearch/compute/operator/topn/TopNOperatorTests.java
This reverts commit 48fcc85.
There was a problem hiding this comment.
Pull request overview
Adds a new JMH benchmark for the ESQL GroupedTopNOperator (LIMIT BY) following the existing TopNBenchmark structure, plus a small test harness to run the benchmark’s selfTest() under the test suite.
Changes:
- Introduce
GroupedTopNBenchmarkJMH benchmark with parameters for sort keys, group keys, and sizes. - Add
GroupedTopNBenchmarkTeststo executeGroupedTopNBenchmark.selfTest().
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| benchmarks/src/main/java/org/elasticsearch/benchmark/_nightly/esql/GroupedTopNBenchmark.java | Implements the grouped top-N benchmark and its self-test. |
| benchmarks/src/test/java/org/elasticsearch/benchmark/_nightly/esql/GroupedTopNBenchmarkTests.java | Adds an ESTestCase wrapper to run the benchmark self-test. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
You can also share your feedback on Copilot code review. Take the survey.
benchmarks/src/main/java/org/elasticsearch/benchmark/_nightly/esql/GroupedTopNBenchmark.java
Outdated
Show resolved
Hide resolved
benchmarks/src/main/java/org/elasticsearch/benchmark/_nightly/esql/GroupedTopNBenchmark.java
Outdated
Show resolved
Hide resolved
|
Pinging @elastic/es-analytical-engine (Team:Analytics) |
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Organization UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (3)
📝 WalkthroughWalkthroughThis change introduces a new JMH benchmark class ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
Comment |
|
Planning has been disabled by your administrator. You can enable it by adding the following to your issue_enrichment:
planning:
enabled: true |
nik9000
left a comment
There was a problem hiding this comment.
Looks good to me. Let's get it in.
It isn't a surprise that it's slower to topn with groups. It's slower to agg with groups too.
|
And we can and will optimize this more as time goes on. |
Operator added in elastic#143476 Similar structure as TopNBenchmark, with similar parameters to keep the comparison consistent. Benchmark results for some similar cases (Compared with TopN): ``` TopNBenchmark Benchmark (data) (sortedInput) (topCount) Mode Cnt Score Error Units TopNBenchmark.run longs_asc_and_bytes_refs_asc false 10 avgt 7 56.292 ± 0.922 ns/op TopNBenchmark.run longs_asc_and_bytes_refs_asc false 1000 avgt 7 54.866 ± 1.091 ns/op GroupedTopNBenchmark Benchmark (data) (groupCount) (groupKeys) (topCount) Mode Cnt Score Error Units GroupedTopNBenchmark.run longs_asc_and_bytes_refs_asc 1 longs 10 avgt 7 103.886 ± 10.041 ns/op GroupedTopNBenchmark.run longs_asc_and_bytes_refs_asc 1 longs 1000 avgt 7 103.321 ± 5.021 ns/op GroupedTopNBenchmark.run longs_asc_and_bytes_refs_asc 100 longs 10 avgt 7 118.975 ± 7.685 ns/op GroupedTopNBenchmark.run longs_asc_and_bytes_refs_asc 100 longs 1000 avgt 7 205.589 ± 30.058 ns/op ```
Operator added in #143476
Similar structure as TopNBenchmark, with similar parameters to keep the comparison consistent.
Benchmark results for some similar cases (Compared with TopN):