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

Claus Ibsen commented on CAMEL-8262:
------------------------------------

Yeah likely for 2.14.x branch.

But 2.15 forward I think its better to switch to use whats out of the box in 
the JDK and avoid the 2x maps and always lower casing the keys at put time.

The JDK case insensitive comparator do a faster check without creating new 
objects and work on the backing char array of the String key.

> Optimize CaseInsensitiveMap
> ---------------------------
>
>                 Key: CAMEL-8262
>                 URL: https://issues.apache.org/jira/browse/CAMEL-8262
>             Project: Camel
>          Issue Type: Improvement
>          Components: camel-core
>            Reporter: Claus Ibsen
>            Assignee: Claus Ibsen
>             Fix For: 2.15.0
>
>
> The CaseInsensitiveMap can be optimized as currently we keep 2 maps with the 
> original keys + lower case keys.
> But all that can be done from the JDK using a TreeMap with a case insenstice 
> comparator from the JDK itself. This reduces memory (only 1 map) and also 
> better performance as its one map, with the trade-off that walking the map 
> using entrySet no longer supports mutations.



--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Reply via email to