perf: optimize bucket counting and tracking in LongKeyedBucketOrds#22450
perf: optimize bucket counting and tracking in LongKeyedBucketOrds#22450rajat315315 wants to merge 3 commits into
Conversation
PR Reviewer Guide 🔍(Review updated until commit d0f6b04)Here are some key observations to aid the review process:
|
PR Code Suggestions ✨Latest suggestions up to d0f6b04 Explore these optional code suggestions:
Previous suggestionsSuggestions up to commit 1e3b18d
Suggestions up to commit 7f3a278
Suggestions up to commit 43c8f88
Suggestions up to commit ccec60b
Suggestions up to commit aba4ca9
|
aba4ca9 to
ccec60b
Compare
|
Persistent review updated to latest commit ccec60b |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## main #22450 +/- ##
============================================
- Coverage 73.39% 73.39% -0.01%
- Complexity 76397 76431 +34
============================================
Files 6105 6104 -1
Lines 346613 346566 -47
Branches 49888 49880 -8
============================================
- Hits 254403 254353 -50
- Misses 71958 71987 +29
+ Partials 20252 20226 -26 ☔ View full report in Codecov by Harness. 🚀 New features to boost your workflow:
|
msfroh
left a comment
There was a problem hiding this comment.
Thanks @rajat315315 !
This looks good overall. I left some pretty minor cleanup comments.
|
Persistent review updated to latest commit 43c8f88 |
|
❌ Gradle check result for 43c8f88: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
|
Persistent review updated to latest commit 7f3a278 |
|
❌ Gradle check result for 7f3a278: FAILURE Please examine the workflow log, locate, and copy-paste the failure(s) below, then iterate to green. Is the failure a flaky test unrelated to your change? |
… maintaining per-bucket counts and max ordinal metadata. Signed-off-by: Your Name <rajatjain.ix@gmail.com>
…cket counting Signed-off-by: Your Name <rajatjain.ix@gmail.com>
7f3a278 to
1e3b18d
Compare
|
Persistent review updated to latest commit 1e3b18d |
|
@rajat315315 -- one last thing. I noticed that your commits are signed off with: Unless I'm mistaken, our DCO rules want each commit signed using a real name. Can you please run |
Signed-off-by: Rajat Jain <rajatjain.ix@gmail.com>
1e3b18d to
d0f6b04
Compare
|
Done. |
|
Persistent review updated to latest commit d0f6b04 |
Description
This PR optimizes$O(N)$ linear scans in $O(1)$ operations:
LongKeyedBucketOrds.FromManyto replacebucketsInOrdandmaxOwningBucketOrdwithmaxOwningBucketOrddynamically as a class field updated on insertions.owningBucketOrdin aLongArraymanaged byBigArrays, incrementing it incrementally.Tests and Verification
./gradlew :server:test --tests "org.opensearch.search.aggregations.bucket.terms.LongKeyedBucketOrdsTests"passed successfully../gradlew spotlessJavaCheck.By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
Related Issues
Resolves #22449
Check List
By submitting this pull request, I confirm that my contribution is made under the terms of the Apache 2.0 license.
For more information on following Developer Certificate of Origin and signing off your commits, please check here.