[ 
https://issues.apache.org/jira/browse/ARTEMIS-2170?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16692837#comment-16692837
 ] 

ASF GitHub Bot commented on ARTEMIS-2170:
-----------------------------------------

Github user franz1981 commented on a diff in the pull request:

    https://github.com/apache/activemq-artemis/pull/2427#discussion_r234906424
  
    --- Diff: 
artemis-core-client/src/main/java/org/apache/activemq/artemis/core/message/impl/CoreMessage.java
 ---
    @@ -578,34 +567,41 @@ public CoreMessage setUserID(UUID userID) {
        /**
         * I am keeping this synchronized as the decode of the Properties is 
lazy
         */
    -   protected TypedProperties checkProperties() {
    +   protected final TypedProperties getOrCreateProperties() {
    --- End diff --
    
    The reason why I haven't done it is due to `ClientMessageImpl extends 
CoreMessage implements ClientMessageInternal`: `ClientMessageInternal` has 
already a `geProperties` method while `CoreMessage::getProperties` has been 
turned into final...
    I can drop the final just to have a better name, but I would prefer to keep 
it final to avoid any child of `CoreMessage` to broke its thread-safeness 
contract by overriding it.


> Optimized CoreMessage's checkProperties and cleanupInternalProperties methods
> -----------------------------------------------------------------------------
>
>                 Key: ARTEMIS-2170
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2170
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker
>            Reporter: Francesco Nigro
>            Assignee: Francesco Nigro
>            Priority: Minor
>
> CoreMessage::checkProperties perform too many volatile read/write and has a 
> too big body just to handle exceptional cases, while 
> cleanupInternalProperties is called on the hot path of session send, but is 
> performing too many synchronized operations and loopup on TypedProperties.



--
This message was sent by Atlassian JIRA
(v7.6.3#76005)

Reply via email to