[ https://issues.apache.org/jira/browse/CXF-6826?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15187887#comment-15187887 ]
Sergey Beryozkin commented on CXF-6826: --------------------------------------- Hi Alessio, thanks, it is tempting to optimize it this way :-) but I have my doubts right now. We can have a leak here if we have users doing media type versioning, ex, "a/b+v1", "a/b+v2" or composite subtypes in general or using media type parameters, in addition to the type/subtype. Can we have: a non-static map as as we have a single RuntimeDelegateImpl caching a media type header provider and some standard collection with FIFO, say as soon as the size reaches say 20 MT variations (as might be the case with parameters or composite subtypes) they start getting evicted ? Thanks, Sergey > Cache MediaTypeHeaderProvider.valueOf(String mType) results > ----------------------------------------------------------- > > Key: CXF-6826 > URL: https://issues.apache.org/jira/browse/CXF-6826 > Project: CXF > Issue Type: Improvement > Components: JAX-RS > Reporter: Alessio Soldano > > MediaTypeHeaderProvider.valueOf(String mType) ends up being called a lot with > the same parameter values, as those are basically the contents of the > @Produce annotations on resources. Each request ends up into the same > invocation, which is cpu and memory intensive. > It might make sense to add a map in the MediaTypeHeaderProvider to store the > result of the static valueOf method invocation. -- This message was sent by Atlassian JIRA (v6.3.4#6332)