Recommended way of decoding non-framed messages?

brunodecarvalho kindernade at gmail.com
Sun Aug 1 20:34:55 EDT 2010


Benoit,


On Sun, 2010-08-01 at 17:12 -0700, tsuna wrote:
> Regarding the paragraph you quoted from JLS, do you have any idea as to
> why
> > it is "prohibitively expensive" to store the stack trace?
> 
> Yeah, I understand their point, and it seemed to contradict Netty's
> javadoc.
> 

Actually, I was kind of expecting you'd shed some light on my understanding
of this cost. I've tried to find something that backed up that JLS statement
but I really didn't find anything.

I've tested throwing new Exceptions versus throwing previously existing
exceptions and the difference is rather big; something like this (after
proper warmup):

throw new Exception() = 192321723ns
cached Exception      = 1118ns

This is for 100000 throws.
Yeah, I know, it's a micro benchmark and micro benchmarks are worth what
they're worth... but seems like caching exceptions and reusing them is very
cheap.

What do you think?


Cheers,
  Bruno
-- 
View this message in context: http://netty-forums-and-mailing-lists.685743.n2.nabble.com/Recommended-way-of-decoding-non-framed-messages-tp5357958p5362377.html
Sent from the Netty User Group mailing list archive at Nabble.com.


More information about the netty-users mailing list