Annotation of OpenXM/src/k097/debug/int.k, Revision 1.1
1.1 ! maekawa 1:
! 2: Println("SSWork/yacc/debug/int.k 1997, 3/10 cf. SSWork/yacc/memo.txt");
! 3: Println("Check the performance of loop");
! 4: /* As to timing data, please see SSWork/yacc/memo.txt */
! 5: Println("Loaded foo1 foo2");
! 6:
! 7: def void foo1() {
! 8: local i,j,one,hundred ;
! 9: Println("sm1 native for loop");
! 10: sm1(" { 1 1 100 { /ii set 1 1 100 {/jj set } for } for } timer ");
! 11: Println("k0 loop with sm1.integer.");
! 12: one = sm1(" 1 "); hundred = sm1(" 100 ");
! 13: sm1(" set_timer ");
! 14: for (i=one; i< hundred ; i=i+one) {
! 15: for (j=one; j< hundred ; j = j+one) {
! 16: ;
! 17: }
! 18: }
! 19: sm1(" set_timer ");
! 20: /* sm1(" set_timer ");
! 21: for (i=sm1(" 1 "); i< sm1(" 100 ") ; i=i+sm1(" 1 ")) {
! 22: for (j=sm1(" 1 "); j<sm1(" 100 ") ; j = j+sm1(" 1 ")) {
! 23: ;
! 24: }
! 25: }
! 26: sm1(" set_timer "); */
! 27: Println("Now, k0 loop with k0.integer (sm1.universalNumber). Please wait patiently.");
! 28: sm1(" set_timer ");
! 29: for (i=1; i<100; i=i+1 ) {
! 30: for (j=1; j<100;j=j+1) {
! 31: ;
! 32: }
! 33: }
! 34: sm1(" set_timer ");
! 35: }
! 36:
! 37: def void foo2() {
! 38: local i,j,one,hundred, a;
! 39: Println("Array Indexing.");
! 40: a = NewVector(101);
! 41: one = sm1(" 1 "); hundred = sm1(" 100 ");
! 42: sm1(" set_timer ");
! 43: for (i=one; i< hundred ; i=i+one) {
! 44: for (j=one; j< hundred ; j = j+one) {
! 45: a[i] = i;
! 46: if ( i + j < sm1(" 100 ")) { a[i+j] = -1; }
! 47: }
! 48: }
! 49: sm1(" set_timer ");
! 50: Println("Now, k0 loop with k0.integer (sm1.universalNumber). Please wait patiently.");
! 51: sm1(" set_timer ");
! 52: for (i=1; i<100; i=i+1 ) {
! 53: for (j=1; j<100;j=j+1) {
! 54: a[i] = i;
! 55: if ( i + j < 100 ) { a[i+j] = -1; }
! 56: }
! 57: }
! 58: sm1(" set_timer ");
! 59: }
! 60:
FreeBSD-CVSweb <freebsd-cvsweb@FreeBSD.org>