vsop-479 commented on PR #16851:
URL: https://github.com/apache/lucene/pull/16851#issuecomment-6869891108
Thanks @jainankitk for the review .
The motivation is to take advantage of `PriorityQueue#addAll`, which builds
the heap from all the elements at once, rather than inserting them one by one.
> Given it makes the code harder to read, is there any associated
performance improvement?
Indeed, I am considering reverting the complex changes because they make the
code too hard to read(I haven't measured the performance). Just keep the simple
changes, such as:
```
// before:
for (ScoreDoc scoreDoc : hits) {
pq.add(scoreDoc);
}
// after:
pq.addAll(hits);
```
--
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
To unsubscribe, e-mail: [email protected]
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]