richardstartin commented on a change in pull request #7708:
URL: https://github.com/apache/pinot/pull/7708#discussion_r744138298



##########
File path: 
pinot-segment-local/src/main/java/org/apache/pinot/segment/local/io/util/FixedByteValueReaderWriter.java
##########
@@ -56,14 +57,28 @@ public String getUnpaddedString(int index, int 
numBytesPerValue, byte paddingByt
     assert buffer.length >= numBytesPerValue;
 
     long startOffset = (long) index * numBytesPerValue;
-    for (int i = 0; i < numBytesPerValue; i++) {
-      byte currentByte = _dataBuffer.getByte(startOffset + i);
-      if (currentByte == paddingByte) {
-        return new String(buffer, 0, i, UTF_8);
+    int written = 0;
+    long pattern = (paddingByte & 0xFFL) * 0x101010101010101L;
+    ByteBuffer wrapper = ByteBuffer.wrap(buffer);
+    for (int i = 0; i < ((numBytesPerValue >>> 3) << 3); i += 8) {
+      long word = _dataBuffer.getLong(startOffset + i);
+      wrapper.putLong(i, word);
+      long zeroed = word ^ pattern;
+      long tmp = (zeroed & 0x7F7F7F7F7F7F7F7FL) + 0x7F7F7F7F7F7F7F7FL;
+      tmp = ~(tmp | zeroed | 0x7F7F7F7F7F7F7F7FL);
+      int end = Long.numberOfLeadingZeros(tmp) >>> 3;

Review comment:
       I've implemented this to move things forward




-- 
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: commits-unsubscr...@pinot.apache.org

For queries about this service, please contact Infrastructure at:
us...@infra.apache.org



---------------------------------------------------------------------
To unsubscribe, e-mail: commits-unsubscr...@pinot.apache.org
For additional commands, e-mail: commits-h...@pinot.apache.org

Reply via email to