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


##########
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:
   I wonder if we could fetch values in bulk from (valueOffset, valueOffset + 
len) instead of fetching them one by one.



##########
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;

Review Comment:
   Should we also enforce that cardinality > 0 here? Also having a java doc 
suggesting that this only works with fixed cardinality?



-- 
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