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

Consolidate temporary buffers in Java's TCompactProtocol

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Minor
    • Resolution: Fixed
    • Affects Version/s: None
    • Fix Version/s: 0.10.0
    • Component/s: Java - Library
    • Labels:
      None
    • Patch Info:
      Patch Available
    • Flags:
      Patch

      Description

      TCompactProtocol allocates a number of small temporary buffers per-instance and, in some cases e.g. readDouble(), per-method-call. It's fairly trivial to consolidate these & save maybe 32 bytes of overhead per TCompactProtocol instance and possibly a bunch more for structs that contain lots of doubles.

      Seems like we can also avoid allocating empty ByteBuffers + byte[]s in readBinary() by returning singletons.

        Attachments

          Activity

            People

            • Assignee:
              thomaslee Tom Lee
              Reporter:
              thomaslee Tom Lee
            • Votes:
              0 Vote for this issue
              Watchers:
              4 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: