diff options
Diffstat (limited to 'src/junit/com/jogamp/common/util/IntIntHashMapTest.java')
-rw-r--r-- | src/junit/com/jogamp/common/util/IntIntHashMapTest.java | 26 |
1 files changed, 15 insertions, 11 deletions
diff --git a/src/junit/com/jogamp/common/util/IntIntHashMapTest.java b/src/junit/com/jogamp/common/util/IntIntHashMapTest.java index 54f3399..cf3fd20 100644 --- a/src/junit/com/jogamp/common/util/IntIntHashMapTest.java +++ b/src/junit/com/jogamp/common/util/IntIntHashMapTest.java @@ -143,7 +143,8 @@ public class IntIntHashMapTest { final IntIntHashMap intmap = new IntIntHashMap(1024); final HashMap<Integer, Integer> map = new HashMap<Integer, Integer>(1024); - out.println(intmap.getClass().getName()+" vs "+map.getClass().getName()); + out.println(intmap.getClass().getName()+" vs "+map.getClass().getName()+ + " warmup: " + warmup); out.println("put"); long time = nanoTime(); @@ -153,7 +154,6 @@ public class IntIntHashMapTest { long intmapPutTime = (nanoTime() - time); out.println(" iimap: " + intmapPutTime/1000000.0f+"ms"); - time = nanoTime(); for (int i = 0; i < iterations; i++) { map.put(rndKeys[i], rndValues[i]); @@ -164,32 +164,36 @@ public class IntIntHashMapTest { System.out.println(); System.out.println("get"); - long intmapGetTime = (nanoTime() - time); - out.println(" iimap: " + intmapGetTime/1000000.0f+"ms"); + time = nanoTime(); for (int i = 0; i < iterations; i++) { intmap.get(rndValues[i]); } - - long mapGetTime = (nanoTime() - time); - out.println(" map: " + mapGetTime/1000000.0f+"ms"); + long intmapGetTime = (nanoTime() - time); + out.println(" iimap: " + intmapGetTime/1000000.0f+"ms"); + + time = nanoTime(); for (int i = 0; i < iterations; i++) { map.get(rndValues[i]); } + long mapGetTime = (nanoTime() - time); + out.println(" map: " + mapGetTime/1000000.0f+"ms"); out.println(); out.println("remove"); - long intmapRemoveTime = (nanoTime() - time); - out.println(" iimap: " + intmapRemoveTime/1000000.0f+"ms"); + time = nanoTime(); for (int i = 0; i < iterations; i++) { intmap.remove(rndValues[i]); } + long intmapRemoveTime = (nanoTime() - time); + out.println(" iimap: " + intmapRemoveTime/1000000.0f+"ms"); - long mapRemoveTime = (nanoTime() - time); - out.println(" map: " + mapRemoveTime/1000000.0f+"ms"); + time = nanoTime(); for (int i = 0; i < iterations; i++) { map.remove(rndValues[i]); } + long mapRemoveTime = (nanoTime() - time); + out.println(" map: " + mapRemoveTime/1000000.0f+"ms"); if(!warmup) { assertTrue("'put' too slow", intmapPutTime <= mapPutTime); |