akka/akka — pull request #1726 by patriknw (2013-09-11 12:51:16+00:00)
Title: =clu #3498 Optimize ClusterHeartbeatSender

No fundamental change was needed. Improved hashing solved it. stringHash was extremely slow.

Test results after the change:

[info] HeartbeatNodeRing of size 1000
[info] - must do a warm up run, 10000 times (4 seconds, 332 milliseconds)
[info] - must produce myReceivers, 10000 times (3 seconds, 971 milliseconds)
[info] - must produce mySenders, 10000 times (16 seconds, 321 milliseconds)
[info] ClusterHeartbeatSenderState of size 1000
[info] - must do a warm up run, 10000 times (4 seconds, 845 milliseconds)
[info] - must reset, 10000 times (4 seconds, 707 milliseconds)
[info] - must addMember node, 10000 times (4 seconds, 552 milliseconds)
[info] - must removeMember node, 10000 times (4 seconds, 571 milliseconds)
[info] - must addHeartbeatRequest node, 10000 times (751 milliseconds)

Before the change "produce myReceivers" took over one minute, and "produce mySenders" never completed (within reasonable time).