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

ASF subversion and git services commented on GEODE-2161:
--------------------------------------------------------

Commit 44278d165750d211a055d19e6e69ec21bb73edd9 in incubator-geode's branch 
refs/heads/feature/GEODE-2156 from zhouxh
[ https://git-wip-us.apache.org/repos/asf?p=incubator-geode.git;h=44278d1 ]

GEODE-2161: avoid unnecessary byte copy of hdos.


> FilterRoutingInfo.FilterInfo.toData does unneeded copying
> ---------------------------------------------------------
>
>                 Key: GEODE-2161
>                 URL: https://issues.apache.org/jira/browse/GEODE-2161
>             Project: Geode
>          Issue Type: Bug
>            Reporter: xiaojian zhou
>            Assignee: xiaojian zhou
>
> This is #52614
> FilterInfo.toData (that was being optimized for murex) does this:
>         // create a hdos
>         // write a bunch of stuff to it
>         byte[] myData = hdos.toByteArray();
>         DataSerializer.writeByteArray(myData, out);
> he toByteArray allocates a new byte array and copies all the data in the hdos 
> to it.
> Then writeByteArray writes it all to "out".
> We can do this instead:
>   if (out instanceof HeapDataOutputStream) {
>     out.writeAsSerializedByteArray(hdos);
>   } else {
>     .. do it the old way
>   }



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

Reply via email to