[ https://issues.apache.org/jira/browse/CXF-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15228538#comment-15228538 ]
Sergey Beryozkin edited comment on CXF-6837 at 4/6/16 4:32 PM: --------------------------------------------------------------- Neal, speaking about the list in the cache, we still do need to have handleMapper() when we check the providers from the cache. Suppose we have MBR<ComplexBook> and MBR<Book> where ComplexBook extends Book. If we add both to the cache when looking for MBR for ComplexBook, then when it is time to get MBR for Book, if we skip the handleMapper() then the chance of MBR<ComplexBook> being selected is 99% because most providers will not assert in isReadable that they only support ComplexBook - they rely on the runtime to check MBR<ComplexBook> - the runtime is not expected to pass Book into it. If so then we do not actually skip handleMapper() was (Author: sergey_beryozkin): Neal, speaking about the list in the cache, we still do need to have handleMapper() when we check the providers from the cache. Suppose we have MBR<ComplexBook> and MBR<Book> where ComplexBook extends Book. If we add both to the cache when looking for MBR for ComplexBook, then when it is time to get MBR for Book, if we skip the handleMapper() then the chance of MBR<ComplexBook> being selected is 99% because most providers will not assert in isReadable that they only support ComplexBook - they rely on the runtime to check MBR<ComplexBook> - the runtime is not expect to pass Book into it. If so then we do not actually skip handleMapper() > 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: ListAProvider.java, ListBProvider.java, > ProviderCache.java, ProviderFactory.patch, Resource.java, beans.xml, web.xml > > > 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)