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

Andrzej Bialecki commented on SOLR-12723:
-----------------------------------------

Agreed, +1 to remove that method.

However, exposing slices as a List<Slice> requires re-packaging them twice (for 
all slices and for active ones), which I guess is ok as long as we make all 
accessors to slices return unmodifiable values, which includes the maps too. 
Otherwise it wouldn't offer any protection against inconsistent modifications 
because you could always modify the maps (and then they would no longer match 
the lists).

> Reduce object creation in HashBasedRouter
> -----------------------------------------
>
>                 Key: SOLR-12723
>                 URL: https://issues.apache.org/jira/browse/SOLR-12723
>             Project: Solr
>          Issue Type: Improvement
>            Reporter: Andrzej Bialecki
>            Assignee: Andrzej Bialecki
>            Priority: Major
>             Fix For: 7.5
>
>         Attachments: SOLR-12723.patch
>
>
> When the default {{CompositeIdRouter}} is used it calls 
> {{HashBasedRouter.hashToSlice}} method for every update, which obtains a 
> collection of active slices from the current {{DocCollection}} and then 
> iterates over it checking what range contains the document's id hash.
> Each time this creates a new iterator, which is wasteful - a much lightweight 
> approach would be to construct a {{Slice[]}} when {{DocCollection}} is 
> constructed and use indexed access to this array.
> This change has especially visible impact on simulator performance for large 
> scale tests, where other costs are not present.



--
This message was sent by Atlassian Jira
(v8.20.10#820010)

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

Reply via email to