cxf-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Daniel Kulp <dk...@apache.org>
Subject Re: Programatically installing interceptors per (Bus|Service|Endpoint)
Date Wed, 21 Mar 2007 20:29:59 GMT
On Wednesday 21 March 2007 15:42, Fred Dushin wrote:
> Someone else mentioned that it might be nice to have he notion of an  
> interceptor id, which I'd fully agree with, so that you could do a  
> lookup by id.  Your interceptor lists are then just (sortable) maps  
> (or multimaps, as the case may be), and lookup can be done in O(lg  
> n).  But that's a pretty disruptive change to the whole  
> architecture.  OTOH, better to do it now than once the cat is out of  
> the bag...

It also has nasty performance impacts as the traversals would be much 
more expensive.  Since those traversals happen on EVERY SINGLE message, 
that would be really bad.   Also, maps use significantly more memory 
than the ArrayLists do. 

My only real thought on this would be to change from List to Set and use 
the CopyOnWriteArraySet.   That keeps the performance of the ArrayList 
for the traversals.   It also gives you the guarantee of uniqueness in 
the Set.   (providing you write an appropriate .equals(...) method)    
The main cost is more expensive "add", "remove", and "contains" methods.   
However, that should be a startup cost in 95% of the cases.  

Anyway, it's a thought.

-- 
J. Daniel Kulp
Principal Engineer
IONA
P: 781-902-8727    C: 508-380-7194
daniel.kulp@iona.com
http://www.dankulp.com/blog

Mime
View raw message