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 2009/01/29 06:21:59 UTC

[jira] Assigned: (THRIFT-288) Generated code iterates maps during write inefficiently

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

Bryan Duxbury reassigned THRIFT-288:
------------------------------------

    Assignee: Bryan Duxbury

> Generated code iterates maps during write inefficiently
> -------------------------------------------------------
>
>                 Key: THRIFT-288
>                 URL: https://issues.apache.org/jira/browse/THRIFT-288
>             Project: Thrift
>          Issue Type: Improvement
>          Components: Compiler (Java)
>            Reporter: Bryan Duxbury
>            Assignee: Bryan Duxbury
>            Priority: Minor
>
> If you look at the way that TBase#write serializes maps, it iterates the keySet and then calls get on the map to actually get the value. This is inefficient for a few reasons. First, if the map keys are base types (byte, int, etc), it will autounbox to get the key, and then re-box the data to do the get() call. Second, even with boxing issues equalized, iterating a map's entrySet instead of its keySet is almost 2x as fast on a HashMap and over 5x as fast with a TreeMap.
> Improvements to this iteration code would benefit protocols.

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