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

Performance penalty of using TDebugProtocol.DuplicateTo

    XMLWordPrintableJSON

Details

    • Improvement
    • Status: Closed
    • Major
    • Resolution: Fixed
    • 0.16.0
    • 0.17.0
    • Go - Library
    • None

    Description

      Currently go library's TDebugProtocol provides 2 features:

      1. debug logging
      2. duplicate write the protocol to another protocol (for size counting, etc.)

      When someone only need the 2nd feature, they still need to pay the price of the 1st feature, even if they set TDebugProtocol.Logger to NopLogger, as we cannot avoid all the fmt.Sprintf calls, and those calls can waste significant cpu resource (in one of our services, the fmt.Sprintf calls from TDebugProtocol counts to 10% of cpu usage).

      Provide a dedicated TDuplicateToProtocol, and deprecate TDebugProtocol.DuplicateTo, to help avoid this performance penalty.

      Attachments

        Issue Links

          Activity

            People

              fishywang Yuxuan Wang
              fishywang Yuxuan Wang
              Votes:
              0 Vote for this issue
              Watchers:
              1 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 - 10m
                  10m