[
https://issues.apache.org/jira/browse/LUCENE-1089?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel#action_12551462
]
Michael McCandless commented on LUCENE-1089:
--------------------------------------------
{quote}
1. Actually there was why I removed the minScore. There's no point in
evaluating minScore with current score because it's been evaluated again in
insertWithOverflow. You don't lose anything by just populating reusableSD and
calling insertWithOverflow. For that reason I removed collect() from
TopFieldDocCollector. To me it looks like a cleaner code, and gain, performance
wise, you only make the same comparison twice.
{quote}
But, imagine a query that has 55K hits to be collected (the avg. from
your tests).
With the original patch, you saved a tiny number of allocations (~70
in your tests) yet added 55K inits of recycledSD and 55K additional
method calls, which is surely a net loss of performance for the
"typical" query. We set out here to improve performance of searching,
but I think the original patch does the reverse.
The proposed (modified) patch, puts back the original optimization
(well, close to it: the original "minScore" is actually the minScore
in the PQ) so we don't have the extra 55K MM inits+method call.
I suppose we could also just make the API addition to PriorityQueue,
but not change how TDC and TFDC and FQ call PriorityQueue.
> Add insertWithOverflow to PriorityQueue
> ---------------------------------------
>
> Key: LUCENE-1089
> URL: https://issues.apache.org/jira/browse/LUCENE-1089
> Project: Lucene - Java
> Issue Type: Improvement
> Affects Versions: 2.3
> Reporter: Shai Erera
> Assignee: Michael McCandless
> Priority: Minor
> Fix For: 2.3
>
> Attachments: LUCENE-1089.take3.patch, PriorityQueue-2.patch,
> PriorityQueue.patch
>
>
> This feature proposes to add an insertWithOverflow to PriorityQueue so that
> callers can reuse the objects that are being dropped off the queue. Also, it
> changes heap to protected for easier extensibility of PQ
--
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: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]