clintropolis commented on a change in pull request #11004:
URL: https://github.com/apache/druid/pull/11004#discussion_r596310946
##########
File path:
processing/src/main/java/org/apache/druid/segment/data/VSizeLongSerde.java
##########
@@ -413,9 +412,81 @@ public void close() throws IOException
}
}
+ /**
+ * Unpack bitpacked long values from an underlying contiguous memory block
+ */
public interface LongDeserializer
{
+ /**
+ * Unpack long value at the specified row index
+ */
long get(int index);
+
+ /**
+ * Unpack a contiguous vector of long values at the specified start index
of length and adjust them by the supplied
+ * delta base value.
+ */
+ default void getDelta(long[] out, int outPosition, int startIndex, int
length, long base)
+ {
+ for (int i = 0; i < length; i++) {
+ out[outPosition + i] = base + get(startIndex + i);
+ }
+ }
+
+ /**
+ * Unpack a non-contiguous vector of long values at the specified indexes
and adjust them by the supplied delta base
+ * value.
+ */
+ default int getDelta(long[] out, int outPosition, int[] indexes, int
length, int indexOffset, int limit, long base)
Review comment:
I haven't measured as you suggest with these exact get methods, (did an
earlier test before they were filled out that seemed to show improvement though
which is why I went down this path because cutting out the extra vector
iteration seemed to be worth the math). i will try to run the numbers this
evening to compare.
----------------------------------------------------------------
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.
For queries about this service, please contact Infrastructure at:
[email protected]
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]