[ 
https://issues.apache.org/jira/browse/THRIFT-3306?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=14935042#comment-14935042
 ] 

ASF GitHub Bot commented on THRIFT-3306:
----------------------------------------

Github user evanj commented on the pull request:

    https://github.com/apache/thrift/pull/596#issuecomment-144037231
  
    Note: the Travis CI build may have failed, but it failed to compile some 
parts of the C++ code, so I suspect this is due to a flaky test and is not 
legitimate, since I didn't touch any of the C++ stuff.


> Java: TBinaryProtocol: Use 1 temp buffer instead of allocating 8
> ----------------------------------------------------------------
>
>                 Key: THRIFT-3306
>                 URL: https://issues.apache.org/jira/browse/THRIFT-3306
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Java - Library
>            Reporter: Evan Jones
>            Priority: Minor
>
> TBinaryProtocol has a member buffer for reading and for serializing each of 
> the integer types. It can get by with only a single one: 8 bytes long for the 
> maximum length integer. This causes a significant reduction in allocations 
> and GC in cases that create the TBinaryProtocol to serialize a single 
> message, instead of reusing it.
> This passes "ant test". I ran the existing SerializationBenchmark and there 
> is no statistically significant difference (the average of 5 runs is smaller 
> on my machine, but I don't think we should read much into that).
> I have a JMH benchmark for this, and it shows that when the TBinaryProtocol 
> is allocated each time, this change is better, but is more or less the same 
> when you reuse the TBinaryProtocol in a loop.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to