DO Loop perfomance ( Progress vs Java )

pcm

New Member
Hi all,

Does anyone has already compare DO Loop performance and function's call between Progress and Java ( two interpreted langage ! ) ?

All of tests are running on W2K - 1.7Ghz

For example this simple procedure

DO i = 1 TO 1000000:

END.

take 4 second in Progress

The same in Java

for (i = 0; i < 1000000; i++) {

}

take 2/3 milliseconds !!!!

Surprising no !

In fact we want to use functions to implement reuse approach, but when we insert a function call in the loop to test the Progress's behavior when a great number of function's calls is used, we obtain more surprising results :

Just a simple proc to test function's call in Progress

FUNCTION inc RETURNS INTEGER (INPUT parm1 AS INTEGER).
RETURN parm1 + 1.
END FUNCTION.

DEF VAR i AS DEC NO-UNDO.
DEF VAR k AS INT NO-UNDO.
DEF VAR e AS INT NO-UNDO.

ASSIGN e = ETIME.
DO i = 1 TO 1000000:
k = inc(k).
END.
MESSAGE ETIME - e k VIEW-AS ALERT-BOX.

take 25 second in Progress

The same in Java

public class TestJava {
public static void main(String[] args) {
int i=0,j=0, k=0;
long starttime = 0;
long stoptime = 0;
long tpstime = 0;
starttime = System.currentTimeMillis();
for (i = 0; i < 100000000; i++) {
k = inc(k);
}
stoptime = System.currentTimeMillis();
tpstime = stoptime - starttime;
System.out.println("Tps : " + tpstime + " " + k);
}
public static int inc ( int k ) {
return k + 1;
}
}

take 375 milliseconds ( for 100 000 000 ! )

Is that means that reuse approach in Progress is impossible due to these performance problems ?

Regards,

pcm
 
Back
Top