2009/6/9 Shai Erera <ser...@gmail.com>: >> If there are no deletions, it's just a null pointer check, right? > > Well ... one null pointer check here, one null pointer check there and at > some point you will see a difference. My point wasn't the null pointer check > itself, but the pointer check for *every* document in mergeFields() and > *every* document in mergeVectors().
I like performance, but it does seem like anything that complicates the code (duplication and specialization) should result in an actual measurable performance increase. But in this specific case (I just looked at the code for mergeVectors) it makes sense because isDeleted() is essentially the *only* thing being done in the loop, and hence we can eliminate the loop entirely (an algorithmic change, not just eliminating a null pointer check per-document in the context of doing something else per-document). patch away ;-) -Yonik http://www.lucidimagination.com --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org