easyice commented on code in PR #13828: URL: https://github.com/apache/lucene/pull/13828#discussion_r1778291944
########## lucene/core/src/java/org/apache/lucene/util/bkd/DocIdsWriter.java: ########## @@ -205,12 +208,16 @@ void readInts(IndexInput in, int count, int[] docIDs) throws IOException { } } - private static DocIdSetIterator readBitSetIterator(IndexInput in, int count) throws IOException { + private DocIdSetIterator readBitSetIterator(IndexInput in, int count) throws IOException { int offsetWords = in.readVInt(); int longLen = in.readVInt(); - long[] bits = new long[longLen]; - in.readLongs(bits, 0, longLen); - FixedBitSet bitSet = new FixedBitSet(bits, longLen << 6); + if (longLen > scratchLongs.length) { Review Comment: It’s an interesting question, currently we have some places that perform the comparison before `growNoCopy` and some that don't. In https://github.com/apache/lucene/pull/13171, I found a slight performance impact regarding the extra assignment like `scratchLongs = scratchLongs`. But indeed, keeping things simple is more important. -- This is an automated message from the Apache Git Service. To respond to the message, please log on to GitHub and use the URL above to go to the specific comment. To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For queries about this service, please contact Infrastructure at: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: issues-unsubscr...@lucene.apache.org For additional commands, e-mail: issues-h...@lucene.apache.org