Issue Details (XML | Word | Printable)

Key: LUCENE-1195
Type: Improvement Improvement
Status: Closed Closed
Resolution: Fixed
Priority: Minor Minor
Assignee: Michael Busch
Reporter: Michael Busch
Votes: 0
Watchers: 3
Operations

If you were logged in you would be able to see more operations.
Lucene - Java

Performance improvement for TermInfosReader

Created: 26/Feb/08 10:59 PM   Updated: 11/Oct/08 12:49 PM
Return to search
Component/s: Index
Affects Version/s: None
Fix Version/s: 2.4

Time Tracking:
Not Specified

File Attachments:
  Size
Text File Licensed for inclusion in ASF works lucene-1195.patch 2008-05-23 02:18 AM Michael Busch 19 kB
Text File Licensed for inclusion in ASF works lucene-1195.patch 2008-05-21 08:37 AM Michael Busch 15 kB
Text File Licensed for inclusion in ASF works lucene-1195.patch 2008-02-27 07:31 PM Michael Busch 4 kB
Java Source File Licensed for inclusion in ASF works SafeThreadLocal.java 2008-09-11 03:12 AM robert engels 1 kB

Lucene Fields: New
Resolution Date: 23/May/08 05:22 PM


 Description  « Hide
Currently we have a bottleneck for multi-term queries: the dictionary lookup is being done
twice for each term. The first time in Similarity.idf(), where searcher.docFreq() is called.
The second time when the posting list is opened (TermDocs or TermPositions).

The dictionary lookup is not cheap, that's why a significant performance improvement is
possible here if we avoid the second lookup. An easy way to do this is to add a small LRU
cache to TermInfosReader.

I ran some performance experiments with an LRU cache size of 20, and an mid-size index of
500,000 documents from wikipedia. Here are some test results:

50,000 AND queries with 3 terms each:
old: 152 secs
new (with LRU cache): 112 secs (26% faster)

50,000 OR queries with 3 terms each:
old: 175 secs
new (with LRU cache): 133 secs (24% faster)

For bigger indexes this patch will probably have less impact, for smaller once more.

I will attach a patch soon.



 All   Comments   Work Log   Change History   Subversion Commits      Sort Order: Ascending order - Click to sort in descending order
No work has yet been logged on this issue.