[ https://issues.apache.org/jira/browse/ARTEMIS-1586?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16318125#comment-16318125 ]
ASF GitHub Bot commented on ARTEMIS-1586: ----------------------------------------- Github user franz1981 commented on a diff in the pull request: https://github.com/apache/activemq-artemis/pull/1757#discussion_r160355213 --- Diff: artemis-commons/src/main/java/org/apache/activemq/artemis/api/core/SimpleString.java --- @@ -259,22 +281,23 @@ public boolean equals(final Object other) { if (other instanceof SimpleString) { SimpleString s = (SimpleString) other; - if (data.length != s.data.length) { - return false; - } - - for (int i = 0; i < data.length; i++) { - if (data[i] != s.data[i]) { - return false; - } - } - - return true; + return ByteUtil.equals(data, s.data); --- End diff -- I will perform some benchs to see if it will impact positively on checks and/or pattern matching based on equals: only in that case I will send a separate improvement PR :+1: > Reduce GC pressure due to String allocations on Core protocol > ------------------------------------------------------------- > > Key: ARTEMIS-1586 > URL: https://issues.apache.org/jira/browse/ARTEMIS-1586 > Project: ActiveMQ Artemis > Issue Type: Improvement > Reporter: Francesco Nigro > Assignee: Francesco Nigro > > The core protocol produce a huge amount of StringValue/SimpleString instances > during CoreMessage decoding of SessionSendMessages. > Often these instances are the same during the lifetime of a client/server > connection: providing efficient interners would help to reduce the GC > pressure, increasing the broker capacity/scalability. -- This message was sent by Atlassian JIRA (v6.4.14#64029)