dev@grizzly.java.net

Re: exception performance in grizzly 2.0

From: gustav trede <gustav.trede_at_gmail.com>
Date: Sat, 31 Jan 2009 14:56:50 +0100

i tested it in the cachetest.

new Exception() is roughly a factor 25 costlier then a new SelectionKeyOP.
that is with a short stacktrace, longer ones deep inside a running
appserver will be more expensive.


2009/1/31 Hubert Iwaniuk <neotyk_at_kungfoo.pl>

> Do you know how much performance we can gain? Just curiouse. H
>
> -original message-
> Subject: exception performance in grizzly 2.0
> From: gustav trede <gustav.trede_at_gmail.com>
> Date: 31-01-2009 13:08
>
> hello,
>
> Its very expensive operation to throw a new exception ,due to the
> fillInStackTrace() (unless its overriden).
>
> for several usage cases it should be ok to use a static final exception
> instance that you can throw.
>
> example: FutureImpl<R>
>
> TimeoutException , CancellationException could be static final
> instances.
>
> Its sad that Throwable failure must be wrapped by an ExecutionException
> ,not much that can improved for that one unless override fillInStackTrace()
> is ok to do.
>
>
> I can make these kind of changes if you agree on it.
>
> --
> regards
> gustav trede
>
>
> ---------------------------------------------------------------------
> To unsubscribe, e-mail: dev-unsubscribe_at_grizzly.dev.java.net
> For additional commands, e-mail: dev-help_at_grizzly.dev.java.net
>
>


-- 
regards
 gustav trede