pekko icon indicating copy to clipboard operation
pekko copied to clipboard

add DirectByteString: a ByteString implementation that uses an off-heap ByteBuffer as backing

Open pjfanning opened this issue 6 months ago • 0 comments

The Pekko ByteString uses a byte array as backing. Netty has support for DirectByteBufs (ByteBufs that use an off-heap ByteBuffer - aka Direct ByteBuffer).

pekko-actor already has DirectByteBufferPool - so in theory, we can reuse the direct ByteBuffers too.

ByteStrings (a ByteString that is a concat of multiple ByteStrings) should hopefully be able to work with DirectByteStrings with little or no changes.

When ByteStrings are compacted, we might want to be able to choose if the compacted ByteString is byte array backed or Direct ByteBuffer backed.

wdyt @He-Pin ?

pjfanning avatar Sep 04 '25 21:09 pjfanning