[ https://issues.apache.org/jira/browse/LUCENE-1476?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12665924#action_12665924 ]
Marvin Humphrey commented on LUCENE-1476: ----------------------------------------- > I implemented the SegmentTermsDocs using DocIdSetIterator.skipTo rather than > nextSetBit. Ah, I see. And you handled the -1 value properly. Well done. > Do you think the skipTo can be optimized? Provided that the compiler is clever enough to inline the various methods within BitVectorDocIdSetIterator (it should be), I don't see a way to improve on that part. It's probably possible to optimize this loop from my patch in BitVector.nextSetBit(), by retrieving the byte value and operating directly on it rather than calling get(). (The compiler would have to be quite clever to figure out that optimization on its own.) {code} + // There's a non-zero bit in this byte. + final int base = pos * 8; + for (int i = 0; i < 8; i++) { + final int candidate = base + i; + if (candidate < size && candidate >= bit) { + if (get(candidate)) { + return candidate; + } + } + } {code} At a higher level, I'd imagine we'd want to store the deleted doc IDs as an integer array rather than a BitVector if there aren't very many of them. But I think that will mess with the random access required by IndexReader.isDeleted(). > BitVector implement DocIdSet, IndexReader returns DocIdSet deleted docs > ----------------------------------------------------------------------- > > Key: LUCENE-1476 > URL: https://issues.apache.org/jira/browse/LUCENE-1476 > Project: Lucene - Java > Issue Type: Improvement > Components: Index > Affects Versions: 2.4 > Reporter: Jason Rutherglen > Priority: Trivial > Attachments: LUCENE-1476.patch, LUCENE-1476.patch, > quasi_iterator_deletions.diff, quasi_iterator_deletions_r2.diff > > Original Estimate: 12h > Remaining Estimate: 12h > > Update BitVector to implement DocIdSet. Expose deleted docs DocIdSet from > IndexReader. -- This message is automatically generated by JIRA. - You can reply to this email to add a comment to the issue online. --------------------------------------------------------------------- To unsubscribe, e-mail: java-dev-unsubscr...@lucene.apache.org For additional commands, e-mail: java-dev-h...@lucene.apache.org