Details
-
Improvement
-
Status: Closed
-
Major
-
Resolution: Fixed
-
4.0.0-alpha-1
-
None
-
None
Description
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:
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
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.