micro benchmarks for OoOJava task dispatch improvement, but behavior or ooo version...
[IRC.git] / Robust / src / Benchmarks / oooJava / micro2 / test.java
1 public class test {
2
3   public static void main( String argv[] ) {
4     
5     long count = 500000;
6     
7     if( argv.length > 0 ) {
8       count = count * Integer.parseInt( argv[0] );
9     }
10             
11     long s = System.currentTimeMillis();
12     long e1;
13     long e2;
14
15     rblock parent {
16       long y = 0;
17       
18       for( long i = 0; i < count; i++ ) {
19
20         // the subsequent sibling has a dependence
21         // on the first
22         rblock child1 {
23           long x = 3;
24         }
25
26         rblock child1 {
27           if( x + 4 == -9 ) {
28             ++y;
29           }
30         }
31
32       }
33       e1 = System.currentTimeMillis();
34     }
35     e2 = System.currentTimeMillis();
36
37     double dt1 = ((double)e1-s)/(Math.pow( 10.0, 3.0 ) );
38     double dt2 = ((double)e2-s)/(Math.pow( 10.0, 3.0 ) );
39     System.out.println( "dt to parent done   ="+dt1+"s" );
40     System.out.println( "dt to parent retired="+dt2+"s" );
41   }
42 }