1. 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

Discussion in 'Stackoverflow tagged OpenEdge or Progress-4GL/DB' started by Ian Stewart, Nov 10, 2017.

Thread Status:
Not open for further replies.
  1. Ian Stewart

    Ian Stewart Guest

    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...
     
  2.  
Thread Status:
Not open for further replies.

Share This Page