[
https://issues.jboss.org/browse/JGRP-1133?page=com.atlassian.jira.plugin....
]
Bela Ban commented on JGRP-1133:
--------------------------------
Let's take a step back from making NRW concurrent: it is not as simple as it sounds
(e.g. add() needs to make sure the seqno to add is >= highest_delivered, but
removeMany() also changes highest_delivered ! This requires lockinng of some sort. Also,
if we made NRW concurren, we'd also have to make the Retransmitter and timer classes
concurrent, and they currently aren't.
So the following, less dramatic, changes were made:
- NRW already acquires a lock for add(), removeMany() etc. Therefore, we don't need
ConcurrentHashMap for xmit_table, and - in a first step - replaced it with an
unsynchronized HashMap
- In a second step, we replaced HashMap with RetransmitTable. This is a matrix (N rows of
M message arrays). If we have many keys (seqnos), then a HashMap deteriorates and when
many keys hash to the same bucket, we have to do a linear walk to find an element. The
memory overhead of HashMap is also much bigger than for RetransmitTable: every
Hashmap.Entry has 4 pointers...
- RetransmitTable requires 2 lookups (row and element within the row), whereas HashMap
requires more if we have many seqnos in the map (1 to get the bucket from the hash and
then N to find the element in the linked list of the bucket).
This change made perf go from 132MByte/sec/node on my local box to 148MByte/sec/node !
NakReceiverWindow: make faster
------------------------------
Key: JGRP-1133
URL:
https://issues.jboss.org/browse/JGRP-1133
Project: JGroups
Issue Type: Task
Reporter: Bela Ban
Assignee: Bela Ban
Fix For: 2.12
JProfiler shows that NRW is a bit of a locking hotspot
--
This message is automatically generated by JIRA.
-
For more information on JIRA, see:
http://www.atlassian.com/software/jira