DiversifyingChildren speedup#15902
Open
alessandrobenedetti wants to merge 11 commits intoapache:mainfrom
Open
Conversation
benwtrent
reviewed
Apr 1, 2026
Comment on lines
+162
to
+168
| // --------------------------------------------------------------------------- | ||
| // Throughput benchmarks (annotated @Nightly, not run in normal CI) | ||
| // --------------------------------------------------------------------------- | ||
|
|
||
| private static final int WARMUP_ITERS = 5; | ||
| private static final int MEASURE_ITERS = 20; | ||
|
|
Member
There was a problem hiding this comment.
Why isn't this a JMH benchmark? I am not sure about having "benchmark type things" in test files. JMH provides many of the things we need. (see: benchmark-jmh
Contributor
Author
There was a problem hiding this comment.
I'm planning to remove these before the merge, just leaving them there now, in case you want to validate the benchmarks!
Member
There was a problem hiding this comment.
OK, sweet! I moved them to a JMH benchmark and validated. Yep, I am seeing 50-100% throughput improvements with this change on collecting :D.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
The change is simple, arrays rather than an object + tests .
Some basic benchmarks (still to be fully reviewed):
./gradlew -p lucene/join test --tests "TestDiversifyingNearestChildrenKnnCollectorPerformancetestThroughput*" -Ptests.verbose=true -Ptests.filter=@nightly 2>&1 | grep -E "collect/sec|tests,|SUCCESS|FAIL" | head -15
Original
1> medium-k k= 32 children= 100000 avg= 2,47 ms 40,53 M collect/sec
1> high-k k= 100 children= 100000 avg= 2,57 ms 38,95 M collect/sec
1> small-k k= 10 children= 100000 avg= 3,29 ms 30,43 M collect/sec
1> dense-updates high k k= 100 children= 100000 avg= 3,56 ms 28,09 M collect/sec
1> dense-updates k= 10 children= 100000 avg= 2,90 ms 34,51 M collect/sec
PULL REQUEST
1> small-k k= 10 children= 100000 avg= 1,39 ms 72,17 M collect/sec
1> dense-updates k= 10 children= 100000 avg= 1,78 ms 56,33 M collect/sec
1> high-k k= 100 children= 100000 avg= 1,72 ms 57,99 M collect/sec
1> medium-k k= 32 children= 100000 avg= 1,48 ms 67,77 M collect/sec
1> dense-updates high k k= 100 children= 100000 avg= 2,74 ms 36,52 M collect/sec