[
https://issues.apache.org/jira/browse/CXF-6837?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=15225898#comment-15225898
]
Sergey Beryozkin commented on CXF-6837:
---------------------------------------
Sure, trying to look carefully :-), extract from the patch:
{code:java}
//step1: load provider from cache
if (cache != null) {
List<ProviderInfo<MessageBodyReader<?>>> pis =
cache.getReader(type, mediaType);
if (pis != null && pis.size() > 0) {
for (ProviderInfo<MessageBodyReader<?>> ep : pis) {
if (matchesReaderCriterias(ep, type, genericType,
annotations, mediaType, m)
&& handleMapper(ep, type, m,
MessageBodyReader.class, false)
&& ep.getProvider().isReadable(type, genericType,
annotations, mediaType)) {
return (MessageBodyReader<T>)ep.getProvider();
}
}
}
}
{code}
To me it reads like that after the readers are extracted from the cache they
are checked again ?
This code was there before you added List A and List B tests. (Yes, I did
confirm yesterday, that Type is not effective right now. I think that will need
to be fixed separately - I'll have a look).
> 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)