Possible FSDirectory.DIRECTORIES optimization
1 posts in topic
Flat View  Flat View
TOPIC ACTIONS:
 

Posted By:   david_song
Posted On:   Thursday, February 23, 2006 07:08 PM

I see that "org.apache.lucene.store.FSDirectory.DIRECTORIES" is of type Hashtable, then in the method "getDirectory()" there is a synchronized block on that ojbect. It seems to me redundant to use Hashtable, as the comments in the code says, we should use HashMap or WeakHashMap.
How much overhead is in using Hashtable and use the redundant synchronized block? Anyone knows how much performance improvement we can get without using Hashtable?

Many thanks.
-DS

Re: Possible FSDirectory.DIRECTORIES optimization

Posted By:   Otis_Gospodnetic  
Posted On:   Friday, February 24, 2006 06:06 PM

My guess is that the performance improvement would be minimal, esp. when compared to more expensive operations such as disk/index reading.

However, patches are always welcome! If you replace Hashtable with a HashMap, please put your patch in Lucene's JIRA ( http://issues.apache.org/jira/browse/LUCENE ), so that we can include it in the next release. Thanks.
About | Sitemap | Contact