ibessonov commented on a change in pull request #174:
URL: https://github.com/apache/ignite-3/pull/174#discussion_r659689560



##########
File path: 
modules/core/src/main/java/org/apache/ignite/internal/util/IgniteUtils.java
##########
@@ -328,14 +334,7 @@ public static ClassLoader igniteClassLoader() {
         if (ldr == null)
             ldr = igniteClassLoader;
 
-        ConcurrentMap<String, Class<?>> ldrMap = classCache.get(ldr);
-
-        if (ldrMap == null) {
-            ConcurrentMap<String, Class<?>> old = classCache.putIfAbsent(ldr, 
ldrMap = new ConcurrentHashMap<>());
-
-            if (old != null)
-                ldrMap = old;
-        }
+        ConcurrentMap<String, Class<?>> ldrMap = 
classCache.computeIfAbsent(ldr, k -> new ConcurrentHashMap<>());

Review comment:
       I also think we had it but results weren't that clear. It seems like 
Java9+ CHashMap works exactly the same. Quick googling revealed that 
computeIfAbsent can be a bottleneck, I would recommend reverting this 
particular fix.
   




-- 
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.

To unsubscribe, e-mail: [email protected]

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


Reply via email to