数据显示了10,000,000次迭代以毫秒计的运行时间:
.Hashtable 与 ConcurrentHashMap在可伸缩性方面的比较
线程数 | ConcurrentHashMap | Hashtable |
1 | 1.00 | 1.03 |
2 | 2.59 | 32.40 |
4 | 5.58 | 78.23 |
8 | 13.21 | 163.48 |
16 | 27.58 | 341.21 |
32 | 57.27 | 778.41 |
数据显示了10,000,000次迭代以毫秒计的运行时间:
.Hashtable 与 ConcurrentHashMap在可伸缩性方面的比较
线程数 | ConcurrentHashMap | Hashtable |
1 | 1.00 | 1.03 |
2 | 2.59 | 32.40 |
4 | 5.58 | 78.23 |
8 | 13.21 | 163.48 |
16 | 27.58 | 341.21 |
32 | 57.27 | 778.41 |