[
https://issues.apache.org/jira/browse/CXF-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15217813#comment-15217813
]
Neal Hu commented on CXF-6837:
------------------------------
Hi Sergey,
First of all, thanks for your comment. I will simplify the ProviderCache code
to have combined key of Type and MediaType in one map.
Secondly, it's not necessary to pass the other two parameters. Because the
original doesn't use these two parameters in handleMapper and
matchesReaderCriterias when select reader/writer except in
isReadable/isWritable. I moved the isReadable/isWritable invocation outside of
matchesReaderCriterias. As you know the customized reader/writer's
isReadable/isWritable could be changed during caching(via injection, has been
proved in CTS). So we cache all canditates match Type and MediaType, get from
cache and invoke isReadable/isWritable. Any comment please let me know. Thanks
a lot.
Neal
> Add cache for MessageBodyReader/Writer
> --------------------------------------
>
> Key: CXF-6837
> URL: https://issues.apache.org/jira/browse/CXF-6837
> Project: CXF
> Issue Type: Improvement
> Components: JAX-RS
> Affects Versions: 3.1.5, 3.0.8
> Environment: windows
> Reporter: Neal Hu
> Fix For: 3.2.0
>
> Attachments: ProviderCache.java, ProviderFactory.patch
>
>
> CXF selects the msgBodyReader/writer in the reader/writer list for every
> request, which has big impact to the performance. Jersey also has the cache
> in
> org.glassfish.jersey.message.internal.MessageBodyFactory._getMessageBodyReader(...).
> I have tried add the cache for CXF in ProviderFactory and been proved that
> it has improved 7-8% for json requests in JMeter. Please let me know if you'd
> like me to add the enhancement for CXF. Thanks.
> http://cxf.547215.n5.nabble.com/MessageBodyReader-Writer-cache-td5767091.html
--
This message was sent by Atlassian JIRA
(v6.3.4#6332)