> > it makes sense because isDeleted() is essentially the *only* thing > being done in the loop, and hence we can eliminate the loop entirely >
You mean that in case there is a matching segment, we can call matchingVectorsReader.rawDocs(rawDocLengths, rawDocLengths2, 0, maxDoc)? But in case it does not have a matching segment, we'd still need to iterate on the docs, and copy the term vectors one by one, right? I'm not very familiar w/ the code, so I'd like to confirm my understanding. Shai On Tue, Jun 9, 2009 at 9:54 PM, Yonik Seeley < yonik.see...@lucidimagination.com> wrote: > 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 > >