Different Maps in JAVA

less than 1 minute read

Published:

reference 1

Chart

map nameThread SafeReadWriteJDK Versionreference
HashMapNoO(1)O(1)1.2ref
HashTableYesO(1)O(1)1.0ref
synchronizedMap()YesO(1)O(1) ref
ConcurrentSkipListMapYesO(log(n))O(log(n))1.6ref
ConcurrentHashMapYesO(1)O(1)1.5ref
EnumMapNoO(1)O(1)1.5ref
IdentityHashMapNoO(1)O(1)1.4ref ref1
LinkedHashMapNoO(1)O(1)1.4ref ref1
TreeMapNoO(log(n))O(log(n))1.2ref ref1
WeakHashMapNoO(1)O(1)1.2ref ref1

FYI

Do prepare such a table, and when you plan to use the Map data structure, reference this table for your design.