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

Reply via email to