[
https://issues.apache.org/jira/browse/ARTEMIS-5121?focusedWorklogId=972300&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-972300
]
ASF GitHub Bot logged work on ARTEMIS-5121:
-------------------------------------------
Author: ASF GitHub Bot
Created on: 09/Jun/25 20:05
Start Date: 09/Jun/25 20:05
Worklog Time Spent: 10m
Work Description: jbertram opened a new pull request, #5757:
URL: https://github.com/apache/activemq-artemis/pull/5757
This commit replaces the matching logic for MQTT subscription IDs which uses
regular expression for a bit of pre-existing logic that I didn't know about
when this functionality was first implemented.
This saves the expense of generating an instance of
`java.util.regex.Pattern` and uses basic `SimpleString` or `char` comparisons
which are optimized for the wildcard address use-case.
This also removes the `createPattern` method from `o.a.a.a.c.s.i.Match`
since the only code using that method has now also been removed. Related tests
have also been removed.
Issue Time Tracking
-------------------
Worklog Id: (was: 972300)
Time Spent: 2.5h (was: 2h 20m)
> Improve performance of MQTT subscription ID matching
> ----------------------------------------------------
>
> Key: ARTEMIS-5121
> URL: https://issues.apache.org/jira/browse/ARTEMIS-5121
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Components: MQTT
> Affects Versions: 2.37.0
> Reporter: Adam Zyzak
> Priority: Major
> Labels: pull-request-available
> Fix For: 2.42.0
>
> Time Spent: 2.5h
> Remaining Estimate: 0h
>
> Recently I performed stress test of a system using Artemis as a message
> broker for MQTT and STOMP protocols. I noticed huge difference in performance
> and CPU usage between these protocols.
> I made some jstacks and it shown that majority of time is spent in method
> {{o.a.a.a.c.p.m.MQTTSessionState#getMatchingSubscriptionIdentifiers}}
> compiling regular expressions.
> It would be helpful if performance of this method was improved, especially
> since it is executed on every publish, either by caching compiled patterns,
> adding special cases for simpler topic names (topic names without special
> characters may be compared using equality, {{#}} subscriptions can be always
> added and topic names having {{#}} at the end can be compared using
> {{startsWith()}}) or just adding option to configuration allowing to skip
> adding SUBSCRIPTION_IDENTIFIER to publish message.
--
This message was sent by Atlassian Jira
(v8.20.10#820010)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]
For further information, visit: https://activemq.apache.org/contact