gf2121 commented on code in PR #14910: URL: https://github.com/apache/lucene/pull/14910#discussion_r2216298380
########## 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: In addition, the vectorized method benchmarks ``` Benchmark (bitLength) Mode Cnt Score Error Units BitsetToArrayBenchmark.denseBranchLessVectorized 256 thrpt 5 17.648 ± 0.059 ops/us BitsetToArrayBenchmark.denseBranchLessVectorized 384 thrpt 5 14.186 ± 0.049 ops/us BitsetToArrayBenchmark.denseBranchLessVectorized 512 thrpt 5 12.102 ± 0.203 ops/us BitsetToArrayBenchmark.denseBranchLessVectorized 768 thrpt 5 9.585 ± 0.068 ops/us BitsetToArrayBenchmark.denseBranchLessVectorized 1024 thrpt 5 7.433 ± 0.093 ops/us BitsetToArrayBenchmark.denseBranchLessVectorizedAVX2 256 thrpt 5 10.885 ± 0.069 ops/us BitsetToArrayBenchmark.denseBranchLessVectorizedAVX2 384 thrpt 5 7.534 ± 0.280 ops/us BitsetToArrayBenchmark.denseBranchLessVectorizedAVX2 512 thrpt 5 6.894 ± 0.019 ops/us BitsetToArrayBenchmark.denseBranchLessVectorizedAVX2 768 thrpt 5 5.068 ± 0.014 ops/us BitsetToArrayBenchmark.denseBranchLessVectorizedAVX2 1024 thrpt 5 3.862 ± 0.109 ops/us BitsetToArrayBenchmark.denseBranchLessVectorizedFromLong 256 thrpt 5 18.918 ± 0.168 ops/us BitsetToArrayBenchmark.denseBranchLessVectorizedFromLong 384 thrpt 5 18.055 ± 0.093 ops/us BitsetToArrayBenchmark.denseBranchLessVectorizedFromLong 512 thrpt 5 17.804 ± 0.079 ops/us BitsetToArrayBenchmark.denseBranchLessVectorizedFromLong 768 thrpt 5 16.803 ± 0.051 ops/us BitsetToArrayBenchmark.denseBranchLessVectorizedFromLong 1024 thrpt 5 17.066 ± 0.042 ops/us ``` -- 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