Solr
  1. Solr
  2. SOLR-2877

SolrInputDocument performance improvements

    Details

      Description

      org.apache.solr.common.SolrInputDocument has only single default constructor.
      Since it's a LinkedHashMap, it's initialised with default initialCapacity=16 and loadFactor=0.75.
      That produces bad performance in situations when your document contains 10000+ different fields.

      org.apache.solr.common.SolrInputDocument class needs to have a constructor that allows to specify initialCapacity and loadFactor arguments.

        Activity

        Hide
        Ryan McKinley added a comment -

        rather then adding the hash functions to SolrInputDocument, what about just adding a constructor where you can pass in the Map explicilty:

          public SolrInputDocument(Map<String,SolrInputField> fields) {
            _fields = fields;
          }
        

        This way you could also avoid using LinkedHashMap if that is not necessary

        Show
        Ryan McKinley added a comment - rather then adding the hash functions to SolrInputDocument, what about just adding a constructor where you can pass in the Map explicilty: public SolrInputDocument(Map< String ,SolrInputField> fields) { _fields = fields; } This way you could also avoid using LinkedHashMap if that is not necessary
        Hide
        Simon Willnauer added a comment -

        This way you could also avoid using LinkedHashMap if that is not necessary

        seems reasonable

        Show
        Simon Willnauer added a comment - This way you could also avoid using LinkedHashMap if that is not necessary seems reasonable
        Hide
        Ryan McKinley added a comment -

        Added in trunk and 3.x

        I did not add anything to CHANGES.txt since I don't think this is significant enough

        Show
        Ryan McKinley added a comment - Added in trunk and 3.x I did not add anything to CHANGES.txt since I don't think this is significant enough
        Hide
        Uwe Schindler added a comment -

        Bulk close after 3.5 is released

        Show
        Uwe Schindler added a comment - Bulk close after 3.5 is released

          People

          • Assignee:
            Ryan McKinley
            Reporter:
            Ivan Hrytsyuk
          • Votes:
            0 Vote for this issue
            Watchers:
            0 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved:

              Time Tracking

              Estimated:
              Original Estimate - 2h
              2h
              Remaining:
              Remaining Estimate - 2h
              2h
              Logged:
              Time Spent - Not Specified
              Not Specified

                Development