cxf-issues mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Sergey Beryozkin (JIRA)" <>
Subject [jira] [Commented] (CXF-6837) Add cache for MessageBodyReader/Writer
Date Wed, 06 Apr 2016 16:11:25 GMT


Sergey Beryozkin commented on CXF-6837:

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. 

> 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