[
https://issues.apache.org/jira/browse/GROOVY-9667?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel
]
Daniel Sun updated GROOVY-9667:
-------------------------------
Affects Version/s: 4.0.0-alpha-1
> Tweak ManagedIdentityConcurrentMap for better performance
> ---------------------------------------------------------
>
> Key: GROOVY-9667
> URL: https://issues.apache.org/jira/browse/GROOVY-9667
> Project: Groovy
> Issue Type: Improvement
> Affects Versions: 4.0.0-alpha-1
> Reporter: Daniel Sun
> Assignee: Daniel Sun
> Priority: Major
> Fix For: 4.0.0-alpha-1
>
> Time Spent: 10m
> Remaining Estimate: 0h
>
> Here is the benchmark project to test the performance of concurrent maps (
> https://github.com/danielsun1106/benchmark-concurrentmaps )
> The result generated on my local machine:
> {code:java}
> Benchmark Mode Cnt Score
> Error Units
> ConcurrentMapBench.testConcurrentIdentityHashMap_get thrpt 15 176.293
> ± 14.399 ops/ms
> ConcurrentMapBench.testConcurrentIdentityHashMap_put thrpt 15 11.263
> ± 8.088 ops/ms
> ConcurrentMapBench.testConcurrentReferenceHashMap_get thrpt 15 197.955
> ± 12.753 ops/ms
> ConcurrentMapBench.testConcurrentReferenceHashMap_put thrpt 15 194.053
> ± 4.108 ops/ms
> ConcurrentMapBench.testManagedConcurrentMap_get thrpt 15 154.559
> ± 5.860 ops/ms
> ConcurrentMapBench.testManagedConcurrentMap_put thrpt 15 10.226
> ± 9.142 ops/ms
> ConcurrentMapBench.testManagedIdentityConcurrentMap_get thrpt 15 140.041
> ± 2.827 ops/ms
> ConcurrentMapBench.testManagedIdentityConcurrentMap_put thrpt 15 6.897
> ± 5.559 ops/ms
> {code}
> According to the performance test report, {{ManagedIdentityConcurrentMap}} is
> as efficient as {{ManagedConcurrentMap}} when executing {{get}} method, but
> less efficient when executing {{put}} method.
> Also, {{ConcurrentReferenceHashMap}} based on {{AbstractMap}} is more
> efficient than other alternatives, so {{ManagedIdentityConcurrentMap}} is
> polished to base on `ConcurrentReferenceHashMap` written by Doug Lea.
> P.S.
> {{ManagedIdentityConcurrentMap}} is introduced since 4.0.0.
> {{ConcurrentIdentityHashMap}} is written by Doug Lea too.
--
This message was sent by Atlassian Jira
(v8.3.4#803005)