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

Performance issue with big message deserialization using php extension

    XMLWordPrintableJSON

    Details

    • Type: Improvement
    • Status: Closed
    • Priority: Major
    • Resolution: Fixed
    • Affects Version/s: 0.9.3
    • Fix Version/s: 0.10.0
    • Component/s: PHP - Library
    • Labels:
      None

      Description

      I have found performance issue when tried to deserialize big thrift binary message with enabled thrift_protocol php extension.

      Messsage size was 10 mb and it took about 30 seconds to deserialize it.

      When i have done debug of php extension and php library i have found that issue is because small read buffer is used in TBufferedTransport and i cannot change it from TBinarySerializer::deserialize method.

      So i have added parameter $buffer_size to function thrift_protocol_read_binary from php extension.

      And also this parameter i have added to method TBinarySerializer::deserialize from php library.

      And i extended class Thrift\Transport\TMemoryBuffer by method putBack, so this class will be used for desearilization without TBufferedTransport warapper.

      After these changes it takes less than a second to deserizlize message with 10 mb size id read buffer 512 kb.

      Here is the pull request https://github.com/apache/thrift/pull/1014

        Attachments

          Activity

            People

            • Assignee:
              kufd Myroslav Kosinskyi
              Reporter:
              kufd Myroslav Kosinskyi
            • Votes:
              0 Vote for this issue
              Watchers:
              2 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: