Uploaded image for project: 'Geode'
  1. Geode
  2. GEODE-2161

FilterRoutingInfo.FilterInfo.toData does unneeded copying

    XMLWordPrintableJSON

Details

    • Bug
    • Status: Closed
    • Major
    • Resolution: Fixed
    • None
    • 1.1.0
    • None
    • None

    Description

      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 }

      Attachments

        Activity

          People

            zhouxj Xiaojian Zhou
            zhouxj Xiaojian Zhou
            Votes:
            0 Vote for this issue
            Watchers:
            2 Start watching this issue

            Dates

              Created:
              Updated:
              Resolved: