cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Neal Hu (JIRA)" <>
Subject [jira] [Commented] (CXF-6837) Add cache for MessageBodyReader/Writer
Date Tue, 05 Apr 2016 11:45:25 GMT


Neal Hu commented on CXF-6837:

1. handleMapper doen't check the genericType of the messagebody can be addressed in another
jira, not cache relavant.
2. sure. the isReadable/isWritable return value can be changed during caching with the same cache
key. so keep one value is wrong. It has been proved in TCK case. 
4.can be moved to construction time, but it is not lazy. current solution is basicly thread
safe, or we change below:
private ProviderCache getProviderCache() {
        if (providerCache == null) {
            if(providerCache == null)
                  providerCache = new ProviderCache();
        return providerCache;
5. we will not occupy so much memory as the instances in the cache are all singleton(or dropped
each time for per-request providers).  

> Add cache for MessageBodyReader/Writer
> --------------------------------------
>                 Key: CXF-6837
>                 URL:
>             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:,,, ProviderFactory.patch,, 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. 

This message was sent by Atlassian JIRA

View raw message