davsclaus commented on code in PR #28651:
URL: https://github.com/apache/camel/pull/28651#discussion_r4413380133


##########
core/camel-base/src/main/java/org/apache/camel/impl/converter/CoreTypeConverterRegistry.java:
##########
@@ -72,6 +73,11 @@ public <T> T convertTo(Class<T> type, Exchange exchange, 
Object value) throws Ty
     // Why 256: as of Camel 4, we have about 230 type converters. Therefore, 
set the capacity to a few more to provide
     // space for others added during runtime
     private final Map<TypeConvertible<?, ?>, TypeConverter> converters = new 
ConcurrentHashMap<>(256);
+    // the results of lookup (MISS_CONVERTER when none was found), as 
resolving a type converter that is not in the
+    // converters map scans all of them, which the enum type converter would 
otherwise do for every conversion
+    private final Map<TypeConvertible<?, ?>, TypeConverter> lookups = new 
ConcurrentHashMap<>();

Review Comment:
   Done: added a comment on why lookups is not pre-sized.
   
   _Claude Code on behalf of Claus Ibsen_



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