netty5/buffer
Nick Hill b0feb5a81f Reduce ByteBuffer duplication when resizing pooled direct ByteBufs ()
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:26:02 -08:00
..
src Reduce ByteBuffer duplication when resizing pooled direct ByteBufs () 2019-11-16 11:26:02 -08:00
pom.xml [maven-release-plugin] prepare for next development iteration 2019-10-24 12:57:00 +00:00