[progress Communities] [progress Openedge Abl] Forum Post: Re: Simple Loop Is Slow Compared...

  • Thread starter Thread starter Patrick Tingen
  • Start date Start date
Status
Not open for further replies.
P

Patrick Tingen

Guest
I did a comparison between ABL and .Net a few months ago. I wrote a double loop with 2 vars, X and Y and let them loop from 1 to 1000 while calculating the Pythagorean theorem for both like this; DEFINE VARIABLE X AS INTEGER NO-UNDO. DEFINE VARIABLE Y AS INTEGER NO-UNDO. ETIME(YES). DO X = 1 TO 1000: DO Y = 1 TO 1000: SQRT(X * X + Y * Y). END. END. MESSAGE ETIME VIEW-AS ALERT-BOX INFO BUTTONS OK. This took around 1060 msec on my computer. The same solution in c# was about 100 times faster in ~ 10msec. The power of .Net runs circles around an ABL solutions in terms of performance. I guess this is the penalty for working in a language that is highly optimized to work with transactions and databases. While I was working on it, I also tested these variations: Remove NO-UNDO -> 1462 msec Use SQRT(EXP(X,2) + EXP(Y,2)) -> 2060 msec Use DECIMAL instead of INTEGER -> 2473 msec All of the above -> 2985 msec

Continue reading...
 
Status
Not open for further replies.
Back
Top