lucene-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Stanislav Livotov (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (SOLR-12699) make LTRScoringModel immutable (to allow hashCode caching)
Date Thu, 30 Aug 2018 19:05:00 GMT

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

Stanislav Livotov commented on SOLR-12699:
------------------------------------------

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


Mime
View raw message