lucene-java-user mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Doug Cutting <>
Subject Re: DocumentWriter, StopFilter should use HashMap... (patch)
Date Thu, 11 Mar 2004 17:04:47 GMT
Erik Hatcher wrote:
> Yes, I saw it.  But is there a reason not to just expose HashSet given 
> that it is the data structure that is most efficient?  I bought into 
> Kevin's arguments that it made sense to just expose HashSet.

Just the general principal that one shouldn't expose more of the 
implementation than one must.  I can imagine faster things than a 
HashSet for this, e.g., a well-coded letter tree (trie) could be a bit 
faster, since it would only touch each character in the key once.  But 
it's not a big deal, perhaps not worth fixing at this point.

I proposed a solution that both respected this concern (yours, as I 
recall) while at the same time avoiding copying.  It doesn't need to be 
an either/or situation.  We can easily hide the implementation, avoid 
copying, and use the most efficient implementation internally.  If you 
no longer care about hiding the implementation, then I guess this is 
moot.  Before we started this exercise the implementation was exposed, 
so things have gotten no worse, only better.  But they could have gotten 
just a little bit better yet!



To unsubscribe, e-mail:
For additional commands, e-mail:

View raw message