• This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn more.

[stackoverflow] [progress Openedge Abl] Performance Of Openedge Concatenation

Status
Not open for further replies.
I

Ian Stewart

Guest
#1
I have noticed in Progress (10.4) that repeated string concatenation can be very slow. For example in the following code.

DEF VAR i AS INT NO-UNDO.
DEF VAR c AS LONGCHAR NO-UNDO.

DO i = 1 TO 1000000:
c = c + STRING(i MOD 10).
END.


From my experience in Java, I think the problem is that each time we are concatenating, we are copying c which is an O(n) operation, so the whole procedure is O(n^2). Java provides the StringBuilder class to solve this problem.

Is my analysis of the problem correct? And if so, is there a solution?

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