we changed the micro benchmark, but why, to get the tasks out of the main method?
authorjjenista <jjenista>
Tue, 30 Nov 2010 23:42:43 +0000 (23:42 +0000)
committerjjenista <jjenista>
Tue, 30 Nov 2010 23:42:43 +0000 (23:42 +0000)
Robust/src/Benchmarks/oooJava/micro/test.java

index 69fd2f7b399057f1d413e0a9be97a93d839aa050..e8c9fd7ed201a1700cefcaa7d2c78f212f269e27 100644 (file)
@@ -3,43 +3,30 @@ public class test {
   public static void main( String argv[] ) {
     
     long count = 500000;
+    int x=1;
     
     if( argv.length > 0 ) {
       count = count * Integer.parseInt( argv[0] );
     }
-            
-    long s = System.currentTimeMillis();
-    long e1;
-    long e2;
+    
+    if( argv.length > 1 ) {
+      x = Integer.parseInt( argv[1] );
+    }
+    mytest(count, x);
+  }
 
-    rblock parent {
-      long x = 3;
-      long y = 0;
+  static void mytest(long count, int x) {
+    for( long i = 0; i < count; i++ ) {
       
-      for( long i = 0; i < count; i++ ) {
-
-        // the parent does a simple variable copy
-        // into this child's record at issue because
-        // the value is definitely available, the
-        // child needs the value read-only
-        rblock child {
-          if( x + 4 == -9 ) {
-          }
-        }
+      // the parent does a simple variable copy
+      // into this child's record at issue because
+      // the value is definitely available, the
+      // child needs the value read-only
+      rblock child {
+       for(int j=0;j<x;j++) {
+         ;
+       }
       }
-      e1 = System.currentTimeMillis();
-      long z = 1;
-    }    
-    // just read vars so compile doesn't throw them out
-    // and force parent of parent to depend on z, for
-    // timing
-    System.out.println( "ignore: "+x+y+z );
-    e2 = System.currentTimeMillis();
-
-
-    double dt1 = ((double)e1-s)/(Math.pow( 10.0, 3.0 ) );
-    double dt2 = ((double)e2-s)/(Math.pow( 10.0, 3.0 ) );
-    System.out.println( "dt to parent done   ="+dt1+"s" );
-    System.out.println( "dt to parent retired="+dt2+"s" );
+    }
   }
 }