Test Code:
01 Import Java.util.hashmap; 02 Import Java.util.map; 03 04 Import Org.Apache.comMons.collections.fasthashMap; 05 06 / ** 07 *
HashmapTester.java P> 08 * 09 *
10 * View source i> 11 * p> 12 * 13 * @Author $ author $ 14 * @version $ transition $ $ 15 * / 16 public class hashmaptester {17 18 / ** 19 * 20 * / 21 public hashmaptester () {22 super (); 23} 24 25 public static void main (string [] args) {26 Int n = 50000; 27 long start = system.currenttimemillis (); 28 map hm = new hashmap (n); 29 for (int i = 0; i Object use " (end / 1000.0) " s "); 50 fHm.setfast (TRUE); 51 start = system.currenttimemillis (); 52 for (int i = 0; i Hashmap Put 50000 Object Using 1.021S Fasthashmap Put 50000 Object Using 1.221S Hashmap get 50000 Object useing0.561s Fasthashmap Get 50000 Object Using0.04S