[jboss-jira] [JBoss JIRA] (JGRP-2400) FRAG4: cache marshalled output with FragmentedMessage
Bela Ban (Jira)
issues at jboss.org
Fri Nov 15 02:18:00 EST 2019
Bela Ban created JGRP-2400:
------------------------------
Summary: FRAG4: cache marshalled output with FragmentedMessage
Key: JGRP-2400
URL: https://issues.jboss.org/browse/JGRP-2400
Project: JGroups
Issue Type: Enhancement
Reporter: Bela Ban
Assignee: Bela Ban
Fix For: 5.0
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 bytes 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).
--
This message was sent by Atlassian Jira
(v7.13.8#713008)
More information about the jboss-jira
mailing list