You are viewing a plain text version of this content. The canonical link for it is here.
Posted to notifications@groovy.apache.org by GitBox <gi...@apache.org> on 2020/07/30 07:32:20 UTC
[GitHub] [groovy] danielsun1106 edited a comment on pull request #1306: GROOVY-9631: Replace legacy data structure with Java collection
danielsun1106 edited a comment on pull request #1306:
URL: https://github.com/apache/groovy/pull/1306#issuecomment-665997982
@blackdrag As to your worries about performance, I created benchmark project to test the performance of concurrent maps ( https://github.com/danielsun1106/benchmark-concurrentmaps )
Here is 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 `ConcurrentMap` is more efficient than other alternatives, so I am going to polish `ManagedIdentityConcurrentMap` and make it base on `ConcurrentReferenceHashMap` written by Doug Lea.
P.S. `ManagedIdentityConcurrentMap` and `ManagedConcurrentMap` are from Groovy 4.0 (master branch), and `ConcurrentIdentityHashMap` is written by Doug Lea too.
----------------------------------------------------------------
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:
users@infra.apache.org