]
Bela Ban updated JGRP-2400:
---------------------------
Fix Version/s: 5.0.3
(was: 5.1)
FRAG4: cache marshalled output with FragmentedMessage
-----------------------------------------------------
Key: JGRP-2400
URL:
https://issues.redhat.com/browse/JGRP-2400
Project: JGroups
Issue Type: Enhancement
Reporter: Bela Ban
Assignee: Bela Ban
Priority: Major
Fix For: 5.0.3
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).