Github user franz1981 commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/1849#discussion_r165944067
--- Diff:
artemis-protocols/artemis-openwire-protocol/src/main/java/org/apache/activemq/artemis/core/protocol/openwire/OpenWireConnection.java
---
@@ -248,8 +255,13 @@ private ConnectionInfo getConnectionInfo() {
//tells the connection that
//some bytes just sent
- public void bufferSent() {
- lastSent = System.currentTimeMillis();
+ private void bufferSent() {
+ //much cheaper than a volatile set if contended, but less precise
(ie allows stale loads)
+ LAST_SENT_UPDATER.lazySet(this, System.currentTimeMillis());
+ }
+
+ private static void traceBufferReceived(Object connectionID, Command
command) {
--- End diff --
I need to add a comment here: it is a trick to allow the caller to be
inlined reducing bytecode size moving away uncommon paths...hence it doesn't
have functional purposes.
---