lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From Bernhard Messer <>
Subject Re: svn-commit: 168449 FSDirectory
Date Mon, 06 Jun 2005 17:24:59 GMT
Hi Daniel,

i just had a look at the new implementation that FSDirectory deletes 
lucene related files only. I like the patch, but i think we left some 
room for optimization. In the current implementation, it's necessary to 
run thru all known Lucene extensions (13 for the moment), for each call 
of "LuceneFileFilter.accept()". If creating an index in a directory 
which contains several hundred files, this definitly will be a 
bottleneck. So creating a new Index in a directory containing 100 files, 
we will endup with 1300 calls to
"if (name.endsWith("."+IndexReader.FILENAME_EXTENSIONS[i]))" which 
always needs to create a new StringBuffer to merge the two strings.

Therefore i would like to propose two changes:
1) we should store the extension in a hash and not in String[] to have a 
faster lookup
2) check for the file extension only without using the "."

any thoughts


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

View raw message