Yuxuan Wang created THRIFT-5539:
-----------------------------------

             Summary: Performance penalty of using TDebugProtocol.DuplicateTo
                 Key: THRIFT-5539
                 URL: https://issues.apache.org/jira/browse/THRIFT-5539
             Project: Thrift
          Issue Type: Improvement
          Components: Go - Library
    Affects Versions: 0.16.0
            Reporter: Yuxuan Wang
            Assignee: Yuxuan Wang


Currently go library's TDebugProtocol provides 2 features:
 # debug logging
 # 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.



--
This message was sent by Atlassian Jira
(v8.20.1#820001)

Reply via email to