From subsecret
No edit summary |
No edit summary |
||
| Line 5: | Line 5: | ||
This version contains only the HashMap part of Colt Project (version 1.2.0) and adds the support for generics, so that it can now be used as a drop-in replacement for Java's HashHamp | This version contains only the HashMap part of Colt Project (version 1.2.0) and adds the support for generics, so that it can now be used as a drop-in replacement for Java's HashHamp | ||
=Download= | |||
abc | abc | ||
=Usage= | |||
{| class="wikitable" | {| class="wikitable" | ||
!Class | !Class | ||
| Line 22: | Line 22: | ||
|Int | |Int | ||
|- | |- | ||
| | |ColtQuickIntIntHashMap | ||
| | |Int | ||
|Int | |Int | ||
|- | |- | ||
| | |ColtIntDoubleHashMap | ||
|Int | |Int | ||
|Double | |||
|- | |- | ||
|ColtLongHashMap | |ColtLongHashMap | ||
|Long | |||
|Int | |Int | ||
|- | |||
|ColtDoubleIntHashMap | |||
|Double | |||
|Int | |Int | ||
|} | |} | ||
abc | abc | ||
=Benchmark= | |||
JVM options: -Xms8g -Xmx8g | JVM options: -Xms8g -Xmx8g | ||
Insertions: 20 million | Insertions: 20 million | ||
Removals: 6 million | Removals: 6 million | ||
Contains key: 4 million | Contains key: 4 million | ||
==Benchmark of Integer,Object== | |||
JVM 1.6 | |||
{| class="wikitable" | |||
!Map | |||
!Insertions (sec.) | |||
!Removals (sec.) | |||
|- | |||
|Java HashMap | |||
|Colt HashMap | |||
|Colt (Native) HashMap | |||
|- | |||
} | |||
JVM 1.7 | |||
==Benchmark of Integer,Integer== | |||
Revision as of 11:33, 14 June 2013
Extension of Colt HashMap using Generics for storage of Objects
This is based on part of the code from Colt Project: http://acs.lbl.gov/software/colt/ The Colt Project is made before generics was introduced in Java. This means that the HashMap from Colt Project cannot be used as a drop-in replacement for Java's HashMap.
This version contains only the HashMap part of Colt Project (version 1.2.0) and adds the support for generics, so that it can now be used as a drop-in replacement for Java's HashHamp
Download
abc
Usage
| Class | Key type | Value type |
|---|---|---|
| ColtIntHashMap | Int | Object |
| ColtIntIntHashMap | Int | Int |
| ColtQuickIntIntHashMap | Int | Int |
| ColtIntDoubleHashMap | Int | Double |
| ColtLongHashMap | Long | Int |
| ColtDoubleIntHashMap | Double | Int |
abc
Benchmark
JVM options: -Xms8g -Xmx8g Insertions: 20 million Removals: 6 million Contains key: 4 million
Benchmark of Integer,Object
JVM 1.6
} JVM 1.7Benchmark of Integer,Integer
| Map | Insertions (sec.) | Removals (sec.) |
|---|---|---|
| Java HashMap | Colt HashMap | Colt (Native) HashMap |