You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@geode.apache.org by "Anthony Baker (JIRA)" <ji...@apache.org> on 2016/12/28 00:02:58 UTC
[jira] [Updated] (GEODE-2161) FilterRoutingInfo.FilterInfo.toData
does unneeded copying
[ https://issues.apache.org/jira/browse/GEODE-2161?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Anthony Baker updated GEODE-2161:
---------------------------------
Fix Version/s: 1.1.0
> 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
> Fix For: 1.1.0
>
>
> 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)