P
Patrick Tingen
Guest
One of my hobbies is to do strange things in the 4GL like writing games (don't ask). In a game every msec counts so I come across a lot of things that cost time. Recently I found out that referencing widget properties in a FIND statement also causes some slowdown. In my animation, I was able to reduce a single animation step from around 30 msec to 2 just by assigning the property value to an integer and doing the FIND with that instead of the property itself. If you compare the performance of the progress compiler with a .Net compiler, you will be embarrassed by the difference. Take this a little program to do some triangle math (Pythagorean theorem). Just calculate the length of the hypotenuse in a double loop: DEFINE VARIABLE a AS INTEGER NO-UNDO. DEFINE VARIABLE b AS INTEGER NO-UNDO. DEFINE VARIABLE c AS INTEGER NO-UNDO. ETIME(YES). DO a = 1 TO 1000: DO b = 1 TO 1000: c = SQRT(a * a + b * b). END. END. MESSAGE ETIME VIEW-AS ALERT-BOX INFO BUTTONS OK. This will cost around 700 msec in the 4GL. Do something similar in .Net and you will see execution times of around 7 msec....
Continue reading...
Continue reading...