码迷,mamicode.com
首页 > 编程语言 > 详细

翻译www.java-performance.com ------JDK class

时间:2016-07-20 19:33:21      阅读:245      评论:0      收藏:0      [点我收藏+]

标签:

 

 


 

Large HashMap overview: JDK, FastUtil, Goldman Sachs, HPPC, Koloboke, Trove - January 2015 version: a quick overview of all major libraries implementing hashmaps.

Tags: hash mapFastUtilGS collectionsHPPCKolobokeTrove.

  • FastUtil 6.6.0 turned out to be consistently fast. It may become even faster if it would introduce any other storage structures except 2 arrays for keys and values.
  • Koloboke is getting second in many tests, but it still outperforms FastUtil in int-int tests.
  • GS implementation is good enough, but is slower than FastUtil and Koloboke.
  • JDK maps are pretty good for Object-Object maps provided that you can tolerate the extra memory consumption and you will call HashMap constructor with required capacity =actual_capacity / fill_factor + 1 to avoid rehashing.
  • Trove suffers from using mod operation for array index calculations and HPPC is too slow due to an extra underlying array (for cell states).

Large HashMap overview: JDK, FastUtil, Goldman Sachs, HPPC, Koloboke, Trove - January 2015 version:
http://java-performance.info/hashmap-overview-jdk-fastutil-goldman-sachs-hppc-koloboke-trove-january-2015/
实现了hashmap的主流库速览。
关键词: hash map, FastUtil, GS collections, HPPC, Koloboke, Trove.
1. FastUtil 6.6.0 还是一贯地快。如果不是使用2个数组储存键与值而采用其他存储结构,它还可能更快。
2. Koloboke 在很多测试中都排到第二,但是在键值类型为int-int测试时胜过FastUtil。
3. JDK 在对象-对象型(Object-Object)map中表现得相当不错。这需要你忍受额外的内存消耗,额外的消耗是在构造HashMap时会需要实际容量/填充因子 + 1 (capacity = actual_capacity / fill_factor + 1)以避免再次散列。
4. Trove 遭受着在数组下标计算中使用取模运算(mod)的诟病,而且为了保存数组元素状态使用了一个隐含的额外数组使得HPPC非常的慢。(HPPC http://labs.carrotsearch.com/hppc.html)

 

翻译www.java-performance.com ------JDK class

标签:

原文地址:http://www.cnblogs.com/re1n/p/5689404.html

(0)
(0)
   
举报
评论 一句话评论(0
登录后才能评论!
© 2014 mamicode.com 版权所有  联系我们:gaon5@hotmail.com
迷上了代码!