Skip to content

DiversifyingChildren speedup#15902

Open
alessandrobenedetti wants to merge 11 commits intoapache:mainfrom
SeaseLtd:diversifyingImprovementMinorHeap
Open

DiversifyingChildren speedup#15902
alessandrobenedetti wants to merge 11 commits intoapache:mainfrom
SeaseLtd:diversifyingImprovementMinorHeap

Conversation

@alessandrobenedetti
Copy link
Copy Markdown
Contributor

@alessandrobenedetti alessandrobenedetti commented Mar 31, 2026

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

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;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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

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.

I'm planning to remove these before the merge, just leaving them there now, in case you want to validate the benchmarks!

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

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.

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants