Protobuf helpers inefficiency

이희승 (Trustin Lee) trustin at gmail.com
Wed Aug 10 22:06:37 EDT 2011


Hello Aleksey,

Internally, FrameDecoder moves the content of the buffer, so we cannot simply slice the buffer. For optimal performance, you might want to merge ProtubufVarint32FrameDecoder and ProtobufDecoder into a single decoder class.

HTH 

-- 
Trustin Lee (http://gleamynode.net/)

On Wednesday, August 10, 2011 at 2:30 AM, Aleksey Yashchenko wrote:

> Hello ALL,
> 
> netty samples use ProtobufVarint32FrameDecoder & Co classes to decode several protobuf messages within one packet. These helpers store VarInt before each message for this purpose. I've just found that they make a separete copy of input ChannelBuffer on each decode() instead of using buffer.slice(). Literally: 
> 
> return buffer.readBytes(length)
> 
> Is there any special idea behind this?
> 
> Thanks!
> 
> ~Leha
> 
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org (mailto:netty-users at lists.jboss.org)
> https://lists.jboss.org/mailman/listinfo/netty-users

-------------- next part --------------
An HTML attachment was scrubbed...
URL: http://lists.jboss.org/pipermail/netty-users/attachments/20110811/218237fb/attachment.html 


More information about the netty-users mailing list