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/04/24 22:13:50 UTC

[jira] Updated: (THRIFT-765) Improved string encoding and decoding performance

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

Bryan Duxbury updated THRIFT-765:
---------------------------------

    Attachment: thrift-765.patch

This patch adds a new class, Utf8Helper, that implements the fast encoding and decoding methods. It also changes Binary and Compact protocols to use this method of encoding.

I haven't benchmarked the overall performance improvements to the respective protocols, but I did perform a micro-benchmark of string encoding and decoding, which showed the new methods take about half as long. The benefit you see in your actual serialization/deserialization will depend on how many strings you use.

> Improved string encoding and decoding performance
> -------------------------------------------------
>
>                 Key: THRIFT-765
>                 URL: https://issues.apache.org/jira/browse/THRIFT-765
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Library (Java)
>    Affects Versions: 0.2
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>             Fix For: 0.3
>
>         Attachments: thrift-765.patch
>
>
> One of the most consistent time-consuming spots of Thrift serialization and deserialization is string encoding. For some inscrutable reason, String.getBytes("UTF-8") is slow. 
> However, it's recently been brought to my attention that DataOutputStream's writeUTF method has a faster implementation of UTF-8 encoding and decoding. We should use this style of encoding.

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