[ 
https://issues.apache.org/jira/browse/LUCENE-502?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Robert Muir resolved LUCENE-502.
--------------------------------

       Resolution: Fixed
    Fix Version/s: 4.0

In trunk, there is no longer a score cache in TermScorer because this is just 
an optimization for the TF/IDF scoring formula.

Instead this optimization is in TFIDFSimilarity, if you want or don't want 
similar pre-computations in your scoring you can adjust this by plugging in 
your own Similarity.


> TermScorer caches values unnecessarily
> --------------------------------------
>
>                 Key: LUCENE-502
>                 URL: https://issues.apache.org/jira/browse/LUCENE-502
>             Project: Lucene - Java
>          Issue Type: Improvement
>          Components: core/search
>    Affects Versions: 1.9
>            Reporter: Steven Tamm
>            Priority: Minor
>             Fix For: 4.0
>
>         Attachments: LUCENE-502.patch, TermScorer.patch
>
>
> TermScorer aggressively caches the doc and freq of 32 documents at a time for 
> each term scored.  When querying for a lot of terms, this causes a lot of 
> garbage to be created that's unnecessary.  The SegmentTermDocs from which it 
> retrieves its information doesn't have any optimizations for bulk loading, 
> and it's unnecessary.
> In addition, it has a SCORE_CACHE, that's of limited benefit.  It's caching 
> the result of a sqrt that should be placed in DefaultSimilarity, and if 
> you're only scoring a few documents that contain those terms, there's no need 
> to precalculate the SQRT, especially on modern VMs.
> Enclosed is a patch that replaces TermScorer with a version that does not 
> cache the docs or feqs.  In the case of a lot of queries, that saves 196 
> bytes/term, the unnecessary disk IO, and extra SQRTs which adds up.

--
This message is automatically generated by JIRA.
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to