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

Hoss Man updated SOLR-7618:
---------------------------
    Attachment: SOLR-7618.patch

Great point Jacob.

A few updates to your patch...

* fix formatting (we use 2 spaces for indents)
* improved javadocs & linkages
* added equivilence testing between each method version (to future proof 
against someone changing one of these methods in the future and making them no 
longer behave consistently)



> MultiFunction.anyExists - creating FunctionValues[] objects for every document
> ------------------------------------------------------------------------------
>
>                 Key: SOLR-7618
>                 URL: https://issues.apache.org/jira/browse/SOLR-7618
>             Project: Solr
>          Issue Type: Bug
>            Reporter: Jacob Graves
>            Priority: Minor
>              Labels: easyfix, newbie, patch, performance
>         Attachments: SOLR-7618.patch, SOLR-7618.patch
>
>   Original Estimate: 2h
>  Remaining Estimate: 2h
>
> In the class org.apache.lucene.queries.function.valuesource.MultiFunction 
> there is the following method signature (line 52)
>      public static boolean allExists(int doc, FunctionValues... values) 
> this method is called from the class 
> org.apache.lucene.queries.function.valuesource.DualFloatFunction (line 68)
>      public boolean exists(int doc) {
>         return MultiFunction.allExists(doc, aVals, bVals);
>      }
> Because MultiFunction.allExists uses Java varargs syntax ("...") a new 
> FunctionValues[] object will be created every time this call takes place.
> The problem is that the call takes place in a document level function, which 
> means that it will create new objects in the heap for every document in the 
> query results.
> for example if you use the following boost function (where ds and dc1 are 
> both TrieDateField)
>      bf=min(ms(ds,dc1),604800000)
> You will get extra objects created for each document in the result set, which 
> has a big impact on performance and memory usage if you are searching a large 
> result set.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

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

Reply via email to