jpountz commented on PR #13359:
URL: https://github.com/apache/lucene/pull/13359#issuecomment-2176590274
I pushed a new approach. Instead of `prepareSeekExact` returning `void`, it
now returns a `Supplier` and forbids calling any other method on `TermsEnum`
until the `Supplier` has been consumed. There are two benefits:
- Implementations can early exit when they can figure out that the term
doesn't exist without doing any I/O by returning `null`. In turn, this saves
creating scorer on other required clauses of the same query.
- It is easier to split the work between the first and second phases
without duplicating work.
However, there is one downside, which is that you can only do one background
I/O request per `TermsEnum` instance, so you need multiple `TermsEnum`
instances if you want more I/O concurrency than that. This looks like a better
trade-off to me, it only makes things like `PKLookup` a bit more sophisticated
if they want to do I/O concurrency.
The benchmark still reports similar numbers:
Without the change
```
P50: 307
P90: 423
P99: 585
```
With the change
```
P50: 162
P90: 258
P99: 405
```
--
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]