You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@thrift.apache.org by "Bryan Duxbury (JIRA)" <ji...@apache.org> on 2010/07/29 20:45:16 UTC

[jira] Updated: (THRIFT-751) Add clear() method to TBase

     [ 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.