Github user michaelandrepearce commented on a diff in the pull request:
https://github.com/apache/activemq-artemis/pull/1752#discussion_r159993138
--- Diff:
artemis-server/src/main/java/org/apache/activemq/artemis/core/protocol/ServerPacketDecoder.java
---
@@ -83,16 +85,34 @@
public class ServerPacketDecoder extends ClientPacketDecoder {
+ private static final int UUID_LENGTH = 36;
+ private static final int DEFAULT_INTERNER_CAPACITY = 32;
private static final long serialVersionUID = 3348673114388400766L;
- public static final ServerPacketDecoder INSTANCE = new
ServerPacketDecoder();
+ private SimpleString.Interner keysInterner;
+ private TypedProperties.StringValue.Interner valuesInterner;
- private static SessionSendMessage decodeSessionSendMessage(final
ActiveMQBuffer in, CoreRemotingConnection connection) {
+ public ServerPacketDecoder() {
+ this.keysInterner = null;
+ this.valuesInterner = null;
+ }
+
+ private void initializeInternersIfNeeded() {
--- End diff --
If though you think about it address SimpleString really can be shared
every where, if the aim is to achieve / avoid creation of SimpleString's on the
heap where its the same address really, then this can be achieved now in java 8
easily with a normal interner and creating objects within functions.
---