lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Shai Erera (JIRA)" <>
Subject [jira] Commented: (LUCENE-1593) Optimizations to TopScoreDocCollector and TopFieldCollector
Date Sat, 25 Apr 2009 05:13:30 GMT


Shai Erera commented on LUCENE-1593:

bq. Same for BS2.score() and score(HC) - initCountingSumScorer?

I proposed this change, but it is problematic. initCountingSumScorer declares throwing IOE,
but neither any of the ctors or add() declares it. So I cannot add a call to initCountingSumScorer
without breaking back-compat, unless:
* I wrap IOE with RE, but I don't like it very much.
* We close our eyes saying it's not very likely that BS2 is used on its own, outside BooleanQuery
(or BooleanWeight for that matters). I did a short test and added IOE, nothing breaks (at
least on the 'java' side, haven't checked contrib), and I'm pretty confident other code will
not break as well, since the rest of the methods do throw IOE (like score(), next(), skipTo()),
and why would you want to initialize BS2 if not to call these?

What do you think about the 2nd option?

> Optimizations to TopScoreDocCollector and TopFieldCollector
> -----------------------------------------------------------
>                 Key: LUCENE-1593
>                 URL:
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: Search
>            Reporter: Shai Erera
>             Fix For: 2.9
> This is a spin-off of LUCENE-1575 and proposes to optimize TSDC and TFC code to remove
unnecessary checks. The plan is:
> # Ensure that IndexSearcher returns segements in increasing doc Id order, instead of
> # Change TSDC and TFC's code to not use the doc id as a tie breaker. New docs will always
have larger ids and therefore cannot compete.
> # Pre-populate HitQueue with sentinel values in TSDC (score = Float.NEG_INF) and remove
the check if reusableSD == null.
> # Also move to use "changing top" and then call adjustTop(), in case we update the queue.
> # some methods in Sort explicitly add SortField.FIELD_DOC as a "tie breaker" for the
last SortField. But, doing so should not be necessary (since we already break ties by docID),
and is in fact less efficient (once the above optimization is in).
> # Investigate PQ - can we deprecate insert() and have only insertWithOverflow()? Add
a addDummyObjects method which will populate the queue without "arranging" it, just store
the objects in the array (this can be used to pre-populate sentinel values)?
> I will post a patch as well as some perf measurements as soon as I have them.

This message is automatically generated by JIRA.
You can reply to this email to add a comment to the issue online.

To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message