-
Enhancement
-
Resolution: Done
-
Major
-
None
-
None
-
False
-
-
False
-
-
1. Measure the cost of lambda creation on a Map.computeIfAbsent()
2. Compare this (in JMH) to code like this:
val=map.get(key); if(val == null) map.computeIfAbsent()
If the key/value pair has been added to the map, the simple invocation of computeIfAbsent() creates a new lambda on every invocation even if get() returns a non-null value. The lambda is not invoked, but it will still be created.
If this proves to be costly, replace all occurrences in JGroups with the above pattern.
There might be other cases where lambdas are created; check them, too.
Note that this is only important for code on the critical path.