You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by eks dev <ek...@yahoo.co.uk> on 2008/01/23 14:50:49 UTC

Another DisjunctionSumScorer micro-tweak / simplification?

method next() is the only place where DisjunctionSumScorer uses scorerDocQueue.size() method, on other places cached variable is used:
 private int queueSize = -1; // used to avoid size() method calls on scorerDocQueue 

I have tested if these are really mirrored with:
assert(queueSize == scorerDocQueue.size()) : "cached queueSize not in sync with the queue itself";
and they are indeed equivalent.


this value gets practically maintained on two places, any reason for that?  I would suggest to use scorerDocQueue.size()  uniformly as this method gets definitely inlined.  



 




      __________________________________________________________
Sent from Yahoo! Mail - a smarter inbox http://uk.mail..yahoo.com



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


Re: Another DisjunctionSumScorer micro-tweak / simplification?

Posted by Yonik Seeley <yo...@apache.org>.
On Jan 23, 2008 8:50 AM, eks dev <ek...@yahoo.co.uk> wrote:
> this value gets practically maintained on two places, any reason for that?  I would suggest to use scorerDocQueue.size()  uniformly as this method gets definitely inlined.

You're probably right... in the presence of proper inlining, using
scorerDocQueue.size() could actually be slightly faster.  These things
often need to be verified of course.

-Yonik

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