Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Improve performance of TransactionLog.add() in 3.x #15435


Copy link

commented Aug 8, 2019

Backport of #15111 into 3.x line, improves performance of TransactionLog.add() by avoiding LinkedList.remove() call, see the original PR for details.

gdela added 2 commits May 30, 2019
…move() call.

Code may be considered cleaner/simpler now, but the reason for this change is performance. When in a single transaction entries were changed, and then changed again (TransactionalMap.put() called on the same entry), the TransactionLog.add() method did a LinkedList.remove() call which has complexity O(n). The new implementation that uses LinkedHashMap instead of LinkedList+HashMap is up to 20% faster on 1000-entry transaction, and up to three times faster on 10000-entry transaction. On small transactions performance is the same.

This comment has been minimized.

Copy link

commented Aug 8, 2019

Can one of the admins verify this patch?

@mmedenjak mmedenjak requested a review from petrpleshachkov Sep 4, 2019
@mmedenjak mmedenjak merged commit 77ff2d1 into hazelcast:maintenance-3.x Sep 27, 2019

This comment has been minimized.

Copy link

commented Sep 27, 2019

Merging as a clean backport of an already approved PR. Thank you for the back/forward-port @gdela !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
None yet
3 participants
You can’t perform that action at this time.