[
https://issues.apache.org/jira/browse/SOLR-9876?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15888374#comment-15888374
]
ASF GitHub Bot commented on SOLR-9876:
--------------------------------------
Github user dennisgove commented on a diff in the pull request:
https://github.com/apache/lucene-solr/pull/126#discussion_r103494004
--- Diff: solr/core/src/java/org/apache/solr/search/facet/SlotAcc.java ---
@@ -394,7 +394,16 @@ public CountSlotAcc(FacetContext fcontext) {
int[] result;
public CountSlotArrAcc(FacetContext fcontext, int numSlots) {
super(fcontext);
- result = new int[numSlots];
+
+ String key = fcontext.level + this.getClass().getSimpleName();
+ result = (int[]) fcontext.getReusable(key);
+ if (result == null || result.length < numSlots) {
+ result = new int[numSlots];
+ fcontext.addReusable(key, result);
--- End diff --
If null != result is it reasonable to reset the value under the key to the
newly created array?
> Reuse CountSlotArrAcc internal array for same level subFacets
> -------------------------------------------------------------
>
> Key: SOLR-9876
> URL: https://issues.apache.org/jira/browse/SOLR-9876
> Project: Solr
> Issue Type: Improvement
> Security Level: Public(Default Security Level. Issues are Public)
> Components: Facet Module
> Affects Versions: master (7.0)
> Reporter: Rustam Hashimov
> Priority: Minor
> Fix For: master (7.0)
>
>
> All facet processors are processed sequentially. We can reuse CountSlotArrAcc
> internal array across same level facet processors instead of reallocating new
> array for each.
--
This message was sent by Atlassian JIRA
(v6.3.15#6346)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]