[
https://issues.redhat.com/browse/JGRP-2445?page=com.atlassian.jira.plugin...
]
Bela Ban updated JGRP-2445:
---------------------------
Description:
We oftentimes have iteration through a MessageBatch and removal, e.g.
{code:java}
for(Message msg: batch) {
if(condition)
batch.remove(msg);
}
}
{code}
This is inefficient for large batches, as {{MessageBatch.remove()}} iterates through the
batch until it finds the message to be nulled.
It is more efficient to use {{BatchIterator.remove()}}.
Pedro's code: [1]
https://github.com/pruivo/JGroups/tree/t_msg_batch_iterator
was:
We oftentimes have iteration through a MessageBatch and removal, e.g.
{code:java}
for(Message msg: batch) {
if(condition)
batch.remove(msg);
}
}
{code}
This is inefficient for large batches, as {{MessageBatch.remove()}} iterates through the
batch until it finds the message to be nulled.
It is more efficient to use {{BatchIterator.remove()}}.
MessageBatch: removal on iteration is inefficient
-------------------------------------------------
Key: JGRP-2445
URL:
https://issues.redhat.com/browse/JGRP-2445
Project: JGroups
Issue Type: Enhancement
Reporter: Bela Ban
Assignee: Bela Ban
Priority: Major
Fix For: 5.0, 4.2.0
We oftentimes have iteration through a MessageBatch and removal, e.g.
{code:java}
for(Message msg: batch) {
if(condition)
batch.remove(msg);
}
}
{code}
This is inefficient for large batches, as {{MessageBatch.remove()}} iterates through the
batch until it finds the message to be nulled.
It is more efficient to use {{BatchIterator.remove()}}.
Pedro's code: [1]
https://github.com/pruivo/JGroups/tree/t_msg_batch_iterator
--
This message was sent by Atlassian Jira
(v7.13.8#713008)