From 8e09ec4ff603c81b89020df742cf955637e08846 Mon Sep 17 00:00:00 2001 From: Robert Varga Date: Fri, 6 Jun 2014 10:39:35 +0200 Subject: [PATCH] Protocol framework: use pooled ByteBuf allocator This should enhance the default performance characteristics by reusing ByteBufs if possible. With 4.0.19, netty keeps a thread-local cache of direct buffers, so we should see a reduction in buffer copying, if not other effects. Change-Id: I81fcf380f6f3b03187000dbca0dd8507975e8dd1 Signed-off-by: Robert Varga --- .../org/opendaylight/protocol/framework/AbstractDispatcher.java | 2 ++ 1 file changed, 2 insertions(+) diff --git a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractDispatcher.java b/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractDispatcher.java index fef2c71969..635bb1076e 100644 --- a/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractDispatcher.java +++ b/opendaylight/commons/protocol-framework/src/main/java/org/opendaylight/protocol/framework/AbstractDispatcher.java @@ -11,6 +11,7 @@ import com.google.common.base.Preconditions; import io.netty.bootstrap.Bootstrap; import io.netty.bootstrap.ServerBootstrap; import io.netty.channel.Channel; +import io.netty.buffer.PooledByteBufAllocator; import io.netty.channel.ChannelFuture; import io.netty.channel.ChannelInitializer; import io.netty.channel.ChannelOption; @@ -110,6 +111,7 @@ public abstract class AbstractDispatcher, L extends // makes no sense for LocalServer and produces warning b.childOption(ChannelOption.SO_KEEPALIVE, true); } + b.childOption(ChannelOption.ALLOCATOR, PooledByteBufAllocator.DEFAULT); customizeBootstrap(b); if (b.group() == null) { -- 2.36.6