netty5/buffer/src/main
Nick Hill c6bdc2b7dc Reduce ByteBuffer duplication when resizing pooled direct ByteBufs (#9765)
Motivation:

Currently when use of Unsafe is disabled and an internal reallocation is
performed for a direct PooledByteBuf, a one-off temporary duplicate is
made of the source and destination backing nio buffers so that the
copy can be done in a threadsafe manner.

The need for this can be reduced by sharing the temporary duplicate
buffer that is already stored in the corresponding destination
PooledByteBuf instance.

Modifications:

Have PoolArena#memoryCopy(...) take the destination PooledByteBuf
instead of the underlying mem reference and offset, and use
internalNioBuffer() to obtain/initialize a reusable duplicate of the
backing nio buffer.

Result:

Fewer temporary allocations when resizing direct pooled ByteBufs in the
non-Unsafe case
2019-11-16 11:27:03 -08:00
..
java/io/netty/buffer Reduce ByteBuffer duplication when resizing pooled direct ByteBufs (#9765) 2019-11-16 11:27:03 -08:00
resources/META-INF/native-image/io.netty/buffer Update GraalVM Native Image configuration. (#9515) 2019-08-30 09:21:33 +02:00