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

Optimize JavabinCodec to use byte[] backed CharSequence instead of String

    XMLWordPrintableJSON

    Details

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

      Description

      javabin format uses UTF8 format for String serialization and java Strings are UTF16 and java String always days a buffer copy of those UTF16 input.

      So, what I propose is

      • we create a byte[] backed CharSequence implementation say Utf8CharSequence.
      • Optionally, javabinCodec can should be able to return this Utf8CharSequence instead of all Strings
      • If a charAt() or toString() call is made to Utf8CharSequence it creates a String and cache it
      • When this Utf8CharSequence needs to be serialized again in javabin format it should copy the underlying utf8 byte[]

        Attachments

          Issue Links

            Activity

              People

              • Assignee:
                noble.paul Noble Paul
                Reporter:
                noble.paul Noble Paul
              • Votes:
                0 Vote for this issue
                Watchers:
                7 Start watching this issue

                Dates

                • Created:
                  Updated:
                  Resolved: