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

Reduce object creation in HashBasedRouter

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 7.5
    • None
    • 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

        Issue Links

          Activity

            People

              ab Andrzej Bialecki
              ab Andrzej Bialecki
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: