You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "Christopher L. Shannon (Jira)" <ji...@apache.org> on 2019/09/06 15:53:00 UTC
[jira] [Created] (AMQ-7300) LongSequenceGenerator should use
AtomicLongFieldUpdater for performance
Christopher L. Shannon created AMQ-7300:
-------------------------------------------
Summary: LongSequenceGenerator should use AtomicLongFieldUpdater for performance
Key: AMQ-7300
URL: https://issues.apache.org/jira/browse/AMQ-7300
Project: ActiveMQ
Issue Type: Improvement
Components: Broker
Affects Versions: 5.15.10
Reporter: Christopher L. Shannon
Assignee: Christopher L. Shannon
Fix For: 5.16.0
I was doing some performance testing and profiling a broker with a high message throughput and noticed a hot spot on the getNextSequenceId() method of the LongSequenceGenerator class. This class gets used a lot of generating sequences in the broker including messages and currently it's synchronization for the methods.
Instead we can use an AtomicLongFieldUpdater and volatile long to remove the synchronization. Using an AtomicLongFieldUpdater instead of an AtomicLong will prevent having to garbage collect a lot of new objects.
--
This message was sent by Atlassian Jira
(v8.3.2#803003)