Uploaded image for project: 'Thrift'
  1. Thrift
  2. THRIFT-5133

TCompactProtocol string allocation improvement

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.13.0
    • Fix Version/s: 0.14.0
    • Component/s: netstd - Library
    • Labels:
      None

      Description

      WriteStringAsync & ReadStringAsync in TCompactProtocol each allocate a buffer to store UTF8 bytes when converting to and from strings. This buffer has to be cleaned up by the garbage collector (at some point), which can lead to a lot of pressure on the hosting process in high-volume scenarios. Basically a lot of short-lived buffers are being emitted by the library. It's an easy tweak to use a pooled buffer for this work which greatly improves the performance under load.

        Attachments

          Activity

            People

            • Assignee:
              CodeBlanch Mikel Blanchard
              Reporter:
              CodeBlanch Mikel Blanchard
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved:

                Time Tracking

                Estimated:
                Original Estimate - Not Specified
                Not Specified
                Remaining:
                Remaining Estimate - 0h
                0h
                Logged:
                Time Spent - 40m
                40m