Uploaded image for project: 'Solr'
  1. Solr
  2. SOLR-12723

Reduce object creation in HashBasedRouter

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 7.5
    • Component/s: None
    • Labels:
      None

      Description

      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.

        Attachments

        1. SOLR-12723.patch
          25 kB
          Andrzej Bialecki

          Activity

            People

            • Assignee:
              ab Andrzej Bialecki
              Reporter:
              ab Andrzej Bialecki
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: