dev@grizzly.java.net

caching of old cometcontexts ?

From: gustav trede <gustav.trede_at_gmail.com>
Date: Fri, 19 Dec 2008 12:27:39 +0100

salut,

The possibility of minor performance improvements here comes with the price
of currently unhandled risks.

The cost of new instance should be compared to :

cometContext.recycle() cost. clearing structures out with their is not a 0
cost.
ensuring a max cache size.
the cache handling in general has overhead handling its own concurrent
datastructure.
check of individual cometcontexts data structure sizes, should an context
that had 1000 handlers be cached, whats the probability that the next topic
need that ?.
possible use of weak / soft references can help regarding the memory usage
(this is perhaps not needed here , just a general consideration for all kind
of caches )

the total overhead for the cache management must a analyzed to be a known
win situation,
even if it is analyzed to be a win , is it large enough to make the extra
complexity worthwhile ?.

-- 
your servant
 gustav trede
coding is art - not only something that  bring food on the table,
everybody should be able to feel proud about their code,
that they have performed their best considering the given conditions.