You are viewing a plain text version of this content. The canonical link for it is here.
Posted to issues@camel.apache.org by "Grzegorz Grzybek (Jira)" <ji...@apache.org> on 2020/05/14 11:31:00 UTC

[jira] [Commented] (CAMEL-15061) Performance issues with classMap.computeIfAbsent() in DefaultFactoryFinder

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

Grzegorz Grzybek commented on CAMEL-15061:
------------------------------------------

Fixed [here|https://github.com/apache/camel/commit/5698b0df3d16c30aae8561794a166f543c036bb6] in https://github.com/apache/camel/commits/camel-2.25.x.

> Performance issues with classMap.computeIfAbsent() in DefaultFactoryFinder
> --------------------------------------------------------------------------
>
>                 Key: CAMEL-15061
>                 URL: https://issues.apache.org/jira/browse/CAMEL-15061
>             Project: Camel
>          Issue Type: Bug
>            Reporter: Grzegorz Grzybek
>            Assignee: Grzegorz Grzybek
>            Priority: Major
>             Fix For: 2.25.2, 3.4.0
>
>
> When Camel routes start, there are unnecessary calls from class DefaultFactoryFinder in method
> {code}
>    protected Class<?> addToClassMap(String key, ClassSupplier mappingFunction) throws ClassNotFoundException, IOException  {
>         try {
>             return classMap.computeIfAbsent(key, (String classKey) -> { ...
> {code}
> In a Karaf environment with the Java security manager enabled, this causes a massive delay in starting Camel routes, since there are thousands of calls into org.apache.felix.framework.BundleImpl.getEntry(), which is then authorised by the Java Security Manager. Its seems a bulk of these calls could be avoided if the call to classMap.computeIfAbsent() dealt with null values as well.



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