Victsm commented on a change in pull request #29855: URL: https://github.com/apache/spark/pull/29855#discussion_r494490684
########## File path: common/network-common/src/main/java/org/apache/spark/network/protocol/Encoders.java ########## @@ -44,6 +51,71 @@ public static String decode(ByteBuf buf) { } } + /** Bitmaps are encoded with their serialization length followed by the serialization bytes. */ + public static class Bitmaps { + public static int encodedLength(RoaringBitmap b) { + // Compress the bitmap before serializing it + b.trim(); + b.runOptimize(); Review comment: It should be invoked only once. BlockTransferMessage.toByteBuffer is where the initial call to encodedLength happens. It's only called once for each RoaringBitmap in the bitmap array. ---------------------------------------------------------------- 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: us...@infra.apache.org --------------------------------------------------------------------- To unsubscribe, e-mail: reviews-unsubscr...@spark.apache.org For additional commands, e-mail: reviews-h...@spark.apache.org