Solr
  1. Solr
  2. SOLR-8383

SolrCore.java + QParserPlugin.java container initialCapacity tweaks

    Details

    • Type: Task Task
    • Status: Closed
    • Priority: Minor Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 5.5, 6.0
    • Component/s: None
    • Labels:
      None

      Description

      patch against trunk to follow

      1. SOLR-8383.patch
        3 kB
        Christine Poerschke
      2. SOLR-8383.patch
        2 kB
        Christine Poerschke

        Activity

        Hide
        Mike Drob added a comment -

        + HashMap<String, QueryResponseWriter> m= new HashMap<>(14);

        HashMap default load factor is 0.75, so this will still get resized after the 10th item. We should either use the two argument constructor with loadFactor = 1.0 or a larger initial capacity to compensate (19).

        + Map<String, T> result = new LinkedHashMap<>(map.entrySet().size());

        Why not map.size()? Also, same comments about load factor apply.

        Show
        Mike Drob added a comment - + HashMap<String, QueryResponseWriter> m= new HashMap<>(14); HashMap default load factor is 0.75, so this will still get resized after the 10th item. We should either use the two argument constructor with loadFactor = 1.0 or a larger initial capacity to compensate (19). + Map<String, T> result = new LinkedHashMap<>(map.entrySet().size()); Why not map.size() ? Also, same comments about load factor apply.
        Hide
        Christine Poerschke added a comment -

        Thanks for your input Mike. Based on usage I would opt for the two argument constructor with loadFactor 1. Attaching revised patch which also corrects a typo and makes a similar change in QParserPlugin.

        Show
        Christine Poerschke added a comment - Thanks for your input Mike. Based on usage I would opt for the two argument constructor with loadFactor 1. Attaching revised patch which also corrects a typo and makes a similar change in QParserPlugin.
        Hide
        ASF subversion and git services added a comment -

        Commit 1719342 from Christine Poerschke in branch 'dev/trunk'
        [ https://svn.apache.org/r1719342 ]

        SOLR-8383: SolrCore.java + QParserPlugin.java container initialCapacity tweaks

        Show
        ASF subversion and git services added a comment - Commit 1719342 from Christine Poerschke in branch 'dev/trunk' [ https://svn.apache.org/r1719342 ] SOLR-8383 : SolrCore.java + QParserPlugin.java container initialCapacity tweaks
        Hide
        ASF subversion and git services added a comment -

        Commit 1719404 from Christine Poerschke in branch 'dev/branches/branch_5x'
        [ https://svn.apache.org/r1719404 ]

        SOLR-8383: SolrCore.java + QParserPlugin.java container initialCapacity tweaks (merge in revision 1719342 from trunk)

        Show
        ASF subversion and git services added a comment - Commit 1719404 from Christine Poerschke in branch 'dev/branches/branch_5x' [ https://svn.apache.org/r1719404 ] SOLR-8383 : SolrCore.java + QParserPlugin.java container initialCapacity tweaks (merge in revision 1719342 from trunk)

          People

          • Assignee:
            Christine Poerschke
            Reporter:
            Christine Poerschke
          • Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Development