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

FramedTransport implementation that reuses its buffers

    XMLWordPrintableJSON

Details

    • New Feature
    • Status: Closed
    • Blocker
    • Resolution: Fixed
    • None
    • 0.4
    • Java - Library
    • None

    Description

      The current version of TFramedTransport allocates new read and write buffers every time a frame is read or written. This is wasteful, leading to expensive byte[] allocations, soaking up cpu and GC time unnecessarily.

      It would be handy to have an implementation that automatically reuses existing buffers if they're big enough, and grows them as appropriate. My testing shows this to be as much as a 60% reduction in CPU cost in dealing with the transport.

      I think it's important for us to keep separate implementations available, since different applications might prefer to spend the CPU time to avoid having a big chunk of memory permanently allocated.

      Attachments

        1. thrift-831-v2.patch
          26 kB
          Bryan Duxbury
        2. thrift-831.patch
          23 kB
          Bryan Duxbury

        Activity

          People

            bryanduxbury Bryan Duxbury
            bryanduxbury Bryan Duxbury
            Votes:
            0 Vote for this issue
            Watchers:
            3 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: