GregTomkins
Active Member
10.2B on HP-UX
We were running tests on this code and noticed that the elapsed time is significantly and consistently longer (about twice as long) when 'f' is removed and all other conditions are the same.
I realize that calling 'noconv' 100,000 times and concatenating to a LONGCHAR is sketchy, and about alternatives such as using MEMPTR and PUT-BYTES etc.
That said, any thoughts why removing a function that is both empty and unused would have any effect at all, let alone a negative effect?
Code:
DEF VAR h_longchar AS LONGCHAR NO-UNDO.
DEF VAR h_longchar2 AS LONGCHAR NO-UNDO.
def var h_ct as int no-undo.
FUNCTION f RETURNS CHAR ( p_str AS CHAR ): END.
FUNCTION noconv RETURNS CHAR ( p_str AS CHAR ):
RETURN p_str.
END.
DO h_ct = 1 TO 100:
h_longchar = h_longchar + FILL( "a", 1000 ).
END.
DO h_ct = 1 TO LENGTH( h_longchar ):
h_longchar2 = h_longchar2 + noconv( STRING( SUBSTR( h_longchar, h_ct, 1) )).
END.
We were running tests on this code and noticed that the elapsed time is significantly and consistently longer (about twice as long) when 'f' is removed and all other conditions are the same.
I realize that calling 'noconv' 100,000 times and concatenating to a LONGCHAR is sketchy, and about alternatives such as using MEMPTR and PUT-BYTES etc.
That said, any thoughts why removing a function that is both empty and unused would have any effect at all, let alone a negative effect?