A ByteBuffer pool reduces the number of ByteBuffer allocations in the SslTlsSupport.
The reason why SslTlsSupport requires a buffer pool is because the
current SSLEngine implementation always requires a 17KiB buffer for
every 'wrap' and 'unwrap' operation. In most cases, the actual size of the
required buffer is much smaller than that, and therefore allocating a 17KiB
buffer for every 'wrap' and 'unwrap' operation wastes a lot of memory
bandwidth, resulting in application performance degradation.
This implementation is very loosely based on the one from Netty.
A ByteBuffer pool reduces the number of ByteBuffer allocations in the SslTlsSupport. The reason why SslTlsSupport requires a buffer pool is because the current SSLEngine implementation always requires a 17KiB buffer for every 'wrap' and 'unwrap' operation. In most cases, the actual size of the required buffer is much smaller than that, and therefore allocating a 17KiB buffer for every 'wrap' and 'unwrap' operation wastes a lot of memory bandwidth, resulting in application performance degradation.
This implementation is very loosely based on the one from Netty.