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

Remove slow other-range checks from RangeFacetProcessor

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Resolved
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 7.5, 8.0, master (9.0)
    • Fix Version/s: 8.1, master (9.0)
    • Component/s: faceting
    • Labels:
      None

      Description

      RangeFacetProcessor.getFacetRangeCountsDocValues is checking every range name over FacetParams.FacetRangeOther enum via catching IllegalArgumentException from valueOf, rethrowing it as SolrException and picking a branch based on the presence of last one.

      It is very slow due to enormous cost of failed Enum.valueOf.
      Also RangeFacetRequest.FacetRange already have a field with parsed FacetRangeOther value for special ranges or null for ordinary ones.

      Replacing this with simple null check leads to huge performance boost here.
      In real case with a lot of intervals (~2000) whole QTime is reduced from 300ms to 50ms by this patch.

        Attachments

        1. SOLR-13227.patch
          3 kB
          Nikolay Khitrin
        2. profiler.png
          350 kB
          Nikolay Khitrin
        3. SOLR-13227.patch
          3 kB
          Mikhail Khludnev

          Issue Links

            Activity

              People

              • Assignee:
                mkhl Mikhail Khludnev
                Reporter:
                khitrin Nikolay Khitrin
              • Votes:
                0 Vote for this issue
                Watchers:
                5 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: