[
https://issues.apache.org/jira/browse/ARTEMIS-3618?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=17462802#comment-17462802
]
ASF subversion and git services commented on ARTEMIS-3618:
----------------------------------------------------------
Commit 46d1fa66f7bd824038ba32ee08d651f06bff12f3 in activemq-artemis's branch
refs/heads/main from franz1981
[ https://gitbox.apache.org/repos/asf?p=activemq-artemis.git;h=46d1fa6 ]
ARTEMIS-3618 Faster Artemis CORE client MessageListener::onMessage without
SecurityManager
> Faster Artemis CORE client MessageListener::onMessage without SecurityManager
> -----------------------------------------------------------------------------
>
> Key: ARTEMIS-3618
> URL: https://issues.apache.org/jira/browse/ARTEMIS-3618
> Project: ActiveMQ Artemis
> Issue Type: Improvement
> Reporter: Francesco Nigro
> Assignee: Francesco Nigro
> Priority: Major
> Attachments: noSecurityManager.png
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Currently {{{}ClientConsumerImpl{}}}, responsible of calling JMS
> {{{}MessageListener::onMessage{}}}, is installing/restoring the listener
> thread's context ClassLoader by using a secured action regardless any
> security manager is installed.
> This secured action (using {{{}AccessController::doPrivileged{}}}) is very
> heavyweight and can often be as costy (or more) then the user/application
> code handling the received message (see
> [https://bugs.openjdk.java.net/browse/JDK-8062162] for more info).
> The {{SecurityManager}} will be removed in the future (see
> [https://openjdk.java.net/jeps/411]) but until that moment would be nice to
> reduce such cost at least if no {{SecurityManager}} is installed.
> This is a flamegraph showing the listener stack trace:
> !noSecurityManager.png|width=920,height=398!
> As the image shows, in violet, here's the cost of
> {{AccessController::doPrivileged}} is no {{SecurityManager}} is installed ie
> 14 samples
> - handling the message costs 3 samples
> - acknowledge it costs 19 samples
> TLDR {{AccessController::doPrivileged}} cost ~5 times handling the message
> and nearly the same as acking back it
--
This message was sent by Atlassian Jira
(v8.20.1#820001)