You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@activemq.apache.org by "ASF GitHub Bot (JIRA)" <ji...@apache.org> on 2018/01/13 22:23:00 UTC

[jira] [Commented] (ARTEMIS-1606) Change AddressInfo RoutingType Set to use EnumSet

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

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

GitHub user michaelandrepearce opened a pull request:

    https://github.com/apache/activemq-artemis/pull/1777

    ARTEMIS-1606 - Change AddressInfo RoutingType Set to use EnumSet

    Change all use from Set<RoutingType> to EnumSet<RoutingType>
    Deprecating any old exposed interfaces but keeping for back compatibility.
    Address info to avoid iterator on getRoutingType hotpath, like wise can be avoided where single RoutingType is passed in.

You can merge this pull request into a Git repository by running:

    $ git pull https://github.com/michaelandrepearce/activemq-artemis ARTEMIS-1606

Alternatively you can review and apply these changes as the patch at:

    https://github.com/apache/activemq-artemis/pull/1777.patch

To close this pull request, make a commit to your master/trunk branch
with (at least) the following in the commit message:

    This closes #1777
    
----
commit 01a546de10f1fd1315d9c47488f9a1dfd3e64a47
Author: Michael André Pearce <mi...@...>
Date:   2018-01-13T19:47:58Z

    ARTEMIS-1606 - Change AddressInfo RoutingType Set to use EnumSet
    
    Change all use from Set<RoutingType> to EnumSet<RoutingType>
    Deprecating any old exposed interfaces but keeping for back compatibility.
    Address info to avoid iterator on getRoutingType hotpath, like wise can be avoided where single RoutingType is passed in.

----


> Change AddressInfo RoutingType Set to use EnumSet 
> --------------------------------------------------
>
>                 Key: ARTEMIS-1606
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-1606
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>            Reporter: Michael Andre Pearce
>
> RoutingType is a enum, as such can take advantage of the benefits of EnumSet. Its a specialist set designed for Enum's.
> https://docs.oracle.com/javase/7/docs/api/java/util/EnumSet.html
> https://www.techempower.com/blog/2017/02/14/enumset-and-enummap/
> This will reduce memory footprint due to being many times more compact, this is particularly important as this Address Info and Routing Type sets are in the hot path of message flow. And that there is only two routing types currently so a very small enum.
> Also at the same time to remove the iterator from the getRoutingType which is in the hotpath. Like wise we can avoid it if AddressInfo is constructed with a single RoutingType.



--
This message was sent by Atlassian JIRA
(v6.4.14#64029)