You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@wink.apache.org by "Bryant Luk (JIRA)" <ji...@apache.org> on 2009/09/16 19:31:57 UTC

[jira] Updated: (WINK-190) Performance change for SoftConcurrentMap

     [ https://issues.apache.org/jira/browse/WINK-190?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Bryant Luk updated WINK-190:
----------------------------

    Attachment: WINK-190.patch

See:
http://www.ibm.com/developerworks/java/library/j-jtp06197.html
for Pattern #5: The cheap read-write lock trick .

The current WeakHashMap is treated as a read only Map.  Every time there's a modifying operation (put/clear), a copy is made to a new map.

This should keep the thread safe ok while also keeping the WeakHashMap for memory concerns.

> Performance change for SoftConcurrentMap
> ----------------------------------------
>
>                 Key: WINK-190
>                 URL: https://issues.apache.org/jira/browse/WINK-190
>             Project: Wink
>          Issue Type: Improvement
>          Components: Common
>    Affects Versions: 0.2
>            Reporter: Bryant Luk
>            Assignee: Bryant Luk
>             Fix For: 0.2
>
>         Attachments: WINK-190.patch
>
>
> Using a copy on write volatile cache instead of the re-entrant locks provides a good significant performance increase for SoftConcurrentMap.
> The WeakHashMap will be a read only map when doing gets() and when a put()/clear() is made, the cache is copied first and then set as the new cache.
> Patch in a few.

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