gf2121 commented on code in PR #14910: URL: https://github.com/apache/lucene/pull/14910#discussion_r2216226731
########## lucene/core/src/java/org/apache/lucene/internal/vectorization/BitSetUtil.java: ########## @@ -30,11 +34,11 @@ class BitSetUtil { * stored in the provided {@code array}. * * <p>NOTE: Caller need to ensure the {@code array} has a length greater than or equal to {@code - * bitSet.cardinality(from, to) + 1}. + * bitSet.cardinality(from, to) + 16}. */ - static int denseBitsetToArray(FixedBitSet bitSet, int from, int to, int base, int[] array) { - assert bitSet.cardinality(from, to) + 1 <= array.length - : "Array length must be at least bitSet.cardinality(from, to) + 1"; + public final int bitsetToArray(FixedBitSet bitSet, int from, int to, int base, int[] array) { + assert bitSet.cardinality(from, to) + 16 <= array.length + : "Array length must be at least bitSet.cardinality(from, to) + 16"; Objects.checkFromToIndex(from, to, bitSet.length()); Review Comment: Also it is interesting to see forLoop is much faster than while loop, which meets my luceneutil result while previous benchmark did not show. -- 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