[ 
https://issues.apache.org/jira/browse/WINK-175?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=12753607#action_12753607
 ] 

Bryant Luk commented on WINK-175:
---------------------------------

Yes, Doug has multiple threads running (4-CPU machine and 15 concurrent client 
threads).

ConcurrentHashMap is able to perform the get()s without needing to acquire a 
lock.   The (what I believe) common usage scenario that we're looking at is an 
application that reads/writes the same type of data repeatedly.

> Change ProvidersRegistry MediaTypeMap to allow gets to be faster
> ----------------------------------------------------------------
>
>                 Key: WINK-175
>                 URL: https://issues.apache.org/jira/browse/WINK-175
>             Project: Wink
>          Issue Type: Improvement
>          Components: Common
>    Affects Versions: 0.2
>            Reporter: Bryant Luk
>             Fix For: 0.2
>
>
> Doug Larson did some more profiling and pointed out that on the 
> ProvidersRegistry MediaTypeMap, using a ConcurrentHashMap over 
> SimpleConcurrentMap actually improves performance by a few percentage points.
> {code}
>         private final SimpleMap<Class<?>, SoftReference<SimpleMap<MediaType, 
> List<ObjectFactory<T>>>>> providersCache =
>                                                                               
>                                             new SimpleConcurrentMap<Class<?>, 
> SoftReference<SimpleMap<MediaType, List<ObjectFactory<T>>>>>(); ;
> {code}
> While the cache keys (Class<?>) would not be WeakReferences, the values would 
> still be SoftReferences.
> Thoughts?

-- 
This message is automatically generated by JIRA.
-
You can reply to this email to add a comment to the issue online.

Reply via email to