[ 
https://issues.apache.org/jira/browse/ARTEMIS-2844?focusedWorklogId=458218&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-458218
 ]

ASF GitHub Bot logged work on ARTEMIS-2844:
-------------------------------------------

                Author: ASF GitHub Bot
            Created on: 13/Jul/20 17:48
            Start Date: 13/Jul/20 17:48
    Worklog Time Spent: 10m 
      Work Description: franz1981 commented on pull request #3217:
URL: https://github.com/apache/activemq-artemis/pull/3217#issuecomment-657700006


   Adding this test to `MQTTTest`:
   ```java
   @Test
      public void testSendAndReceiveMQTTManyQueues() throws Exception {
         final int NUM_QUEUES = 10_000;
         final MQTTClientProvider subscriptionProvider = 
getMQTTClientProvider();
         initializeConnection(subscriptionProvider);
         final long start = System.currentTimeMillis();
         for (int i = 0; i < NUM_QUEUES;i++) {
            subscriptionProvider.subscribe("foo/" + i, AT_MOST_ONCE);
         }
         final long end = System.currentTimeMillis();
         long elapsed = end - start;
         System.out.println("SUBSCRIBED TO  " + NUM_QUEUES + " in " + elapsed + 
" ms");
         for (int i = 0; i < NUM_QUEUES;i++) {
            subscriptionProvider.unsubscribe("foo/" + i);
         }
         elapsed = System.currentTimeMillis() - end;
         System.out.println("UNSUBSCRIBED TO  " + NUM_QUEUES + " in " + elapsed 
+ " ms");
         subscriptionProvider.disconnect();
      }
   ```
   Deliver a ~2X improvement over `master` on subscribe performance.
   Although not a rigorous benchmark, it already shows a tangible improvement 
over `master`: the real deal would be to move the MQTT logic outside the Netty 
loop to save it from being blocked while iterating all the bindings..
   


----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

For queries about this service, please contact Infrastructure at:
[email protected]


Issue Time Tracking
-------------------

    Worklog Id:     (was: 458218)
    Time Spent: 1h  (was: 50m)

> Improve MQTT subscribe/unsubscribe topic performance
> ----------------------------------------------------
>
>                 Key: ARTEMIS-2844
>                 URL: https://issues.apache.org/jira/browse/ARTEMIS-2844
>             Project: ActiveMQ Artemis
>          Issue Type: Improvement
>          Components: Broker, MQTT
>    Affects Versions: 2.14.0
>            Reporter: Francesco Nigro
>            Priority: Major
>          Time Spent: 1h
>  Remaining Estimate: 0h
>
> MQTT (and not only) is severely effected on its performance while 
> subscribing/unsubscribing when many topics are existing because:
> * SimpleAddressManager::getMatchingBindings/getDirectBindings are performing 
> a linear search on all the existing Bindings 
> * the results of the previous matches are saved into a Bindings instance even 
> if not necessary (note: Bindings perform atomic operations while saving the 
> matching Binding)
> * All the MQTT operations are performed in the Netty event loop



--
This message was sent by Atlassian Jira
(v8.3.4#803005)

Reply via email to