[netty-users] question about performance of FrameDecoder and ChannelBuffer

jdv145 jandevries145 at fastmail.fm
Fri Nov 21 01:38:02 EST 2008


Hi,

I just started using netty myself so i can't really be sure about the
performance and stuff.. but i used a 0 byte delimited frames because that is
easy to decode and easy to fnd the beginning of the next frame if something
goes wrong. As long as you are not sending any binary data (which can
contain 0 bytes) its a pretty good method i think because it is easy, robust
and you can't do much wrong with it. 

But im a bit of a noob here (although my netty-server works no less then
perfect) so im sure someone more knowledgable will answer your question with
some more details :). 

regards,
jan
 

christian wrote:
> 
> Hi,
> 
> I want to implement a protocol decoder with Netty for a protocol that
> hasn't fixed length nor fixed delimiter delimited messages (until I
> look at it that is: XML fragments).
> I think I am going to use the FrameDecoder for this, what do you think
> is the most efficient approach with Netty:
> - in the decode(...) method, should I:
> 
> (a) read all readableBytes() from the ChannelBuffer, try to find the
> message
> disadvantage: I may (quite certainly) read much more than one message
> from the Buffer, but for the sake of simple processing I want to
> decode only one message at a time; i.e. I read messages multiple times
> from the ChannelBuffer until they are "first"
> 
> (b) read a certain amount of bytes (I can make a guess how long an
> average message is), see if there is a complete message in it, if read
> in the next call twice as much and so on
> disadvantage: I may have useless calls to decode(...) and everything
> in it if the fixed buffer size is too small for a message.
> 
> What do you think will be more performant with Netty's FrameDecoder
> and ChannelBuffer?
> Btw, why are the method names for the readIndex and writeIndex in
> ChannelBuffer not named get..()/set...() ?
> 
> 
> thanks in advance,
> best regards,
> christian
> _______________________________________________
> netty-users mailing list
> netty-users at lists.jboss.org
> https://lists.jboss.org/mailman/listinfo/netty-users
> 
> 

-- 
View this message in context: http://n2.nabble.com/question-about-performance-of-FrameDecoder-and-ChannelBuffer-tp1556452p1560649.html
Sent from the Netty User Group mailing list archive at Nabble.com.




More information about the netty-users mailing list