lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Michael McCandless <luc...@mikemccandless.com>
Subject Re: HitQueue.getSentinelObject() and performance
Date Sun, 22 Jan 2017 11:35:11 GMT
Aha!  Thanks for bringing closure...

Mike McCandless

http://blog.mikemccandless.com

On Sat, Jan 21, 2017 at 4:24 PM, Rob Audenaerde
<rob.audenaerde@gmail.com> wrote:
> Hi Mike,
>
> I was curious too, so with the help of your hint I did some more digging.
> You were correct, as I found two occurences using this construction:
>
>     final TopDocs topDocs = indexSearcher.search(pageQuery,
> Integer.MAX_VALUE);
>
> As there are 4.5M documents in this specific index, this caused many calls.
>
> Thanks!
>
> -Rob
>
>
>
> On Fri, Jan 20, 2017 at 5:23 PM, Michael McCandless
> <lucene@mikemccandless.com> wrote:
>>
>> It's curious that you see this as a hot spot.
>>
>> Are you collecting a very large top N docs, relative to how many hits
>> the queries match, maybe?
>>
>> I don't think we can make this a static instance: the collection
>> process will re-use the entry it pulls out of the queue.
>>
>> Mike McCandless
>>
>> http://blog.mikemccandless.com
>>
>>
>> On Fri, Jan 20, 2017 at 10:39 AM, Rob Audenaerde
>> <rob.audenaerde@gmail.com> wrote:
>> > Hi all,
>> >
>> > I'm currently looking at the performance of our application, and I see a
>> > lot
>> > of time being spent in  HitQueue.getSentinelObject()   (I track this
>> > using
>> > the VisualVM sampler)
>> >
>> > When I look at the implementation, I see a new ScoreDoc is constructed
>> > each
>> > time. Is this necessary? Maybe a static will improve the performance a
>> > bit?
>> >
>> >
>> > @Override
>> >   protected ScoreDoc getSentinelObject() {
>> >     // Always set the doc Id to MAX_VALUE so that it won't be favored by
>> >     // lessThan. This generally should not happen since if score is not
>> > NEG_INF,
>> >     // TopScoreDocCollector will always add the object to the queue.
>> >     return new ScoreDoc(Integer.MAX_VALUE, Float.NEGATIVE_INFINITY);
>> >   }
>> >
>> > Thanks in advance,
>> > - Rob
>
>

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org


Mime
View raw message