What is the difference between using the wrapper class, SynchronizedMap
, on a HashMap
and ConcurrentHashMap
?
Is it just bein
A simple performance test for ConcurrentHashMap vs Synchronized HashMap
. The test flow is calling put
in one thread and calling get
in three threads on Map
concurrently. As @trshiv said, ConcurrentHashMap has higher throughput and speed for whose reading operation without lock. The result is when operation times is over 10^7
, ConcurrentHashMap is 2x
faster than Synchronized HashMap.