You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@lucene.apache.org by "Stanislav Livotov (JIRA)" <ji...@apache.org> on 2018/08/30 19:05:00 UTC

[jira] [Comment Edited] (SOLR-12699) make LTRScoringModel immutable (to allow hashCode caching)

    [ https://issues.apache.org/jira/browse/SOLR-12699?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16597789#comment-16597789 ] 

Stanislav Livotov edited comment on SOLR-12699 at 8/30/18 7:04 PM:
-------------------------------------------------------------------

Please note that in the attached patch I tried to make LTRScoringModel immutable object. However, in theory, this object is still mutable because params is a map of String-Object and in theory, Object can be not a String but some complex object and Features are also mutable objects(Only in theory, by the flow they are immutable objects). We can not fix paramsMap, however, we cat try to go further and make them really immutable but it will require as to do a lot of changes because currently in Feature.getInstance method we are invoking setters. So if you think that this code change is not enough I can refactor this part of code too. 


was (Author: slivotov):
Please note that in the attached patch I tried to make LTRScoringModel immutable object. However, in theory, this object is still mutable because params is a map of String-Object and in theory, Object can be not a String but some complex object and Features are also mutable objects. We can not fix paramsMap, however, we cat try to go further and make them really immutable but it will require as to do a lot of changes because currently in Feature.getInstance method we are invoking setters. So if you think that this code change is not enough I can refactor this part of code too. 

> make LTRScoringModel immutable (to allow hashCode caching)
> ----------------------------------------------------------
>
>                 Key: SOLR-12699
>                 URL: https://issues.apache.org/jira/browse/SOLR-12699
>             Project: Solr
>          Issue Type: Sub-task
>      Security Level: Public(Default Security Level. Issues are Public) 
>          Components: contrib - LTR
>            Reporter: Stanislav Livotov
>            Priority: Major
>         Attachments: SOLR-12699.patch
>
>
> [~slivotov] wrote in SOLR-12688:
> bq. ... LTRScoringModel was a mutable object. It was leading to the calculation of hashcode on each query, which in turn can consume a lot of time ... So I decided to make LTRScoringModel immutable and cache hashCode calculation. ...
> (Please see SOLR-12688 description for overall context and analysis results.)



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

---------------------------------------------------------------------
To unsubscribe, e-mail: dev-unsubscribe@lucene.apache.org
For additional commands, e-mail: dev-help@lucene.apache.org