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 09:37:00 UTC

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

Grzegorz Grzybek created CAMEL-15061:
----------------------------------------

             Summary: 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


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)