changeset 192:35f3be8d9ffe

change TreeMapBenchMark
author tatsuki
date Thu, 30 Apr 2015 06:52:06 +0900
parents d484151bc420
children 6819a376de75
files src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/test/TatsukiTreeMapGetThread.java src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/test/UtilTreeMapGetThread.java
diffstat 2 files changed, 12 insertions(+), 10 deletions(-) [+]
line wrap: on
line diff
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/test/TatsukiTreeMapGetThread.java	Thu Apr 30 06:30:26 2015 +0900
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/test/TatsukiTreeMapGetThread.java	Thu Apr 30 06:52:06 2015 +0900
@@ -31,11 +31,12 @@
     @Override
     public void run() {
         while (loop) {
-            Optional<String> value = map.get(findCount % 1000);
-            if (value.isPresent())
-                findCount++;
-            else
-                System.out.println("miss");
+            for (long count = 0 ; count < 1000; count++) {
+                Optional<String> value = map.get(count);
+                if (!value.isPresent())
+                    System.out.println("error");
+            }
+            findCount++;
         }
     }
 }
--- a/src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/test/UtilTreeMapGetThread.java	Thu Apr 30 06:30:26 2015 +0900
+++ b/src/main/java/jp/ac/u_ryukyu/ie/cr/tatsuki/jungle/test/UtilTreeMapGetThread.java	Thu Apr 30 06:52:06 2015 +0900
@@ -28,11 +28,12 @@
     @Override
     public void run() {
         while (loop) {
-            String value = map.get(findCount % 1000);
-            if (value != null)
-                findCount++;
-            else
-                System.out.println("miss");
+            for (long count = 0 ; count < 1000; count++) {
+                String value = map.get(count);
+                if (value == null)
+                    System.out.println("error");
+            }
+            findCount++;
         }
     }
 }
\ No newline at end of file