Uploaded image for project: 'JGroups'
  1. JGroups
  2. JGRP-2400

FRAG4: cache marshalled output with FragmentedMessage

XMLWordPrintable

    • Icon: Enhancement Enhancement
    • Resolution: Won't Do
    • Icon: Major Major
    • 5.0.3
    • None
    • None

      FRAG4 marshals a long message (that has no array) into smaller fragments, e.g. when frag_size==200, a 500 byte message is marshalled into 3 FragmentedMessages of sizes 200, 200 and 100.

      The first FragmentedMessage marshals the entire original message, but only writes the first 200 bytes to the output stream.

      The second FragmentedMessage also marshals the entire original message, and writes the second 200 bytes.

      The third message writes only the last 100 bytes.

      This means that the original message is marshalled 3 times.

      It might be faster to create an object that wraps the original message and a byte array, which represents the marshalled object. When marshalled for the first time, the byte array is created. The second and third time, no marshalling is performed, but instead, the FragmentedMessages access the byte array directly (at the given offsets/lengths).

            rhn-engineering-bban Bela Ban
            rhn-engineering-bban Bela Ban
            Votes:
            0 Vote for this issue
            Watchers:
            1 Start watching this issue

              Created:
              Updated:
              Resolved: