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 <[email protected]> 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: [email protected] For additional commands, e-mail: [email protected]
