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

Examine SortingResponseWriter with an eye towards removing extra object creation

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Resolved
    • Major
    • Resolution: Invalid
    • 6.2, 7.0
    • None
    • None
    • None

    Description

      Assigning to myself just to keep from losing track it. Anyone who wants to take it, please feel free!

      While looking at SOLR-9166 I noticed that SortingResponseWriter does a toString for each field it writes out. At a very preliminary examination it seems like we create a lot of String objects that need to be GC'd. Could we reduce this by using some kind of CharsRef/ByteBuffer/Whatever?

      I've only looked at this briefly, not quite sure what the gotchas are but throwing it out for discussion.

      Some initial thoughts:
      1> for the fixed types (numerics, dates, booleans) there's a strict upper limit on the size of each value so we can allocate something up-front.
      2> for string fields, we already get a chars ref so just pass that through?
      3> must make sure that whatever does the actual writing transfers all the bytes before returning.

      I'm sure I won't get to this for a week or perhaps more, so grab it if you have the bandwidth.

      Attachments

        1. SOLR-9296.patch
          16 kB
          Erick Erickson

        Issue Links

          Activity

            People

              erickerickson Erick Erickson
              erickerickson Erick Erickson
              Votes:
              0 Vote for this issue
              Watchers:
              3 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: