[ 
https://issues.apache.org/jira/browse/THRIFT-751?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
 ]

Bryan Duxbury updated THRIFT-751:
---------------------------------

    Attachment: thrift-751.patch

This adds a clear() method to the TBase interface and updates TUnion and the 
Java generator to supply implementations.

I did a quick microbenchmark to test performance of allocating new objects 
versus clearing one existing one, and found clearing to be about 5x as fast.

> Add clear() method to TBase
> ---------------------------
>
>                 Key: THRIFT-751
>                 URL: https://issues.apache.org/jira/browse/THRIFT-751
>             Project: Thrift
>          Issue Type: New Feature
>          Components: Compiler (Java), Library (Java)
>    Affects Versions: 0.3
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Minor
>             Fix For: 0.4
>
>         Attachments: thrift-751.patch
>
>
> It'd be very handy to be able to quickly empty out a Thrift struct. This 
> would allow one to reuse a Thrift struct reliably. In the Hadoop context, 
> this would lead to a respectable performance benefit.

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to