From subsecret
Jump to: navigation, search

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

Map Insertions (sec.) Removals (sec.)
Java HashMap Colt HashMap Colt (Native) HashMap

JVM 1.7

Benchmark of Integer,Integer