costin commented on code in PR #16283:
URL: https://github.com/apache/lucene/pull/16283#discussion_r3473903991


##########
lucene/core/src/java25/org/apache/lucene/internal/vectorization/PanamaDocValuesRangeSupport.java:
##########
@@ -69,4 +69,60 @@ public void rangeIntoBitSet(
       }
     }
   }
+
+  @Override
+  public void sortedNumericRangeIntoBitSet(
+      LongValues values,
+      int fromDoc,
+      int toDoc,
+      int cardinality,
+      long minValue,
+      long maxValue,
+      FixedBitSet bitSet,
+      int offset) {
+    final int vectorLen = LONG_SPECIES.length();
+    final int docsPerVector = vectorLen / cardinality;
+    if (docsPerVector == 0 || vectorLen % cardinality != 0) {
+      DocValuesRangeSupport.super.sortedNumericRangeIntoBitSet(
+          values, fromDoc, toDoc, cardinality, minValue, maxValue, bitSet, 
offset);
+      return;
+    }
+
+    final long[] scratch = new long[vectorLen];
+    final int vectorDocEnd = fromDoc + (toDoc - fromDoc) / docsPerVector * 
docsPerVector;
+    int doc = fromDoc;
+    for (; doc < vectorDocEnd; doc += docsPerVector) {
+      long valueOffset = (long) doc * cardinality;
+      for (int lane = 0; lane < vectorLen; lane++) {
+        scratch[lane] = values.get(valueOffset + lane);
+      }

Review Comment:
   LongValues only exposes get(long index), there's no bulk API. The underlying 
storage is mmap'd RandomAccessInput, so sequential get() calls are cheap 
(pointer arithmetic + memory access, not syscalls). I've  re-used the pattern 
from the single-valued rangeIntoBitSet() method.



-- 
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: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to