[
https://issues.apache.org/jira/browse/CXF-8149?focusedWorklogId=340991&page=com.atlassian.jira.plugin.system.issuetabpanels:worklog-tabpanel#worklog-340991
]
ASF GitHub Bot logged work on CXF-8149:
---------------------------------------
Author: ASF GitHub Bot
Created on: 10/Nov/19 01:06
Start Date: 10/Nov/19 01:06
Worklog Time Spent: 10m
Work Description: scsosna99 commented on pull request #596: CXF-8149 -
Reduce synchronization in AbstractJXBProvider
URL: https://github.com/apache/cxf/pull/596
Previous version did what I would consider a lot of gratuitous
synchronization which can be reduced in a number of ways.
First, use ConcurrentHashMap instead of straight HashMap for managing for
tracking the contexts created for classes and packages. At that point, we only
need to do serialization when the collections don't already contain a context
for the class or package.
Second, move to a "ConcurrentHashSet" for collectionContextClasses.
Underlying this is a ConcurrentHashMap and is used by ConcurrentHashMap as the
KeySet, so we can create one of these for the collectionContextClasses. At
that point, can again reduce synchronizations required.
These changes were made locally at my company to address these
synchronizations substantially slowing down some of our web services, and
reducing synchronizations substantially improved throughput by - in most cases
- reducing synchronizations and letting threads not block each other.
----------------------------------------------------------------
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.
For queries about this service, please contact Infrastructure at:
[email protected]
Issue Time Tracking
-------------------
Worklog Id: (was: 340991)
Remaining Estimate: 0h
Time Spent: 10m
> Reduce synchronization in AbstractJAXBProvider
> -----------------------------------------------
>
> Key: CXF-8149
> URL: https://issues.apache.org/jira/browse/CXF-8149
> Project: CXF
> Issue Type: Improvement
> Components: JAX-RS
> Affects Versions: 3.3.4
> Reporter: Scott Sosna
> Priority: Major
> Time Spent: 10m
> Remaining Estimate: 0h
>
> My company discovered that there was excessive blocking occurring which was
> tracked down to AbstractJAXBProvider doing synchronizations when checking
> various collections. Instead, using ConcurrentHashMaps and other techniques,
> those synchronizations are only necessary when the collection in fact needs
> modifications, i.e., the first time a specific type is used. After that,
> synchronizations are no longer required and multiple concurrent calls don't
> start blocking each other.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)