‎2008 Jul 14 7:32 PM
Hi all,
i need to convert an xml file to internal table, and after that i need to take out different values from that.
i needed to take out 6 different values, but theprocedue of those was same.
find first occurence of 'string' in itab match result mlin.
read table itab index mlin into itab_h.
split itab_h at '<' into temp, temp1.
split temp1 at '>' into final_result.
First i wrote this piece of code for 6 times but then i thought of making it into subroutine.
but after making a subroutine its performance has reduced.
does calling a subroutine afftects performance in any way?
regards
oin
‎2008 Jul 14 8:33 PM
Hello,
Using subroutines (perform) will definitely not reduce the performance unless some additional coding is done.
Subroutines are used to make the prorgam modular, and help maintainability because you will reduce the code by 1/6th of the total lenght which is very easily and quickly readable.
Check if you did any additional logic/coding after you created the subroutine.
cheers,
Sushil Joshi
‎2008 Jul 14 8:36 PM
hi Sushil,
I just gave a single IF condition there in my subroutine.
thats all .
Regards
oin
‎2008 Jul 15 1:14 PM
Hi OINDRILLA ,
Perform is used basically
for modularisation purpose and
(ii) reduce the redundancy in code.
You want to read values in the same way for all six different values. You follow the same procedure.So,perform should optimize the performance of your program.There is no question of performnace degradation in this case.
if it useful, reward points.
By
Prasad G.V.K
‎2008 Jul 15 1:29 PM
a perform call has some microseconds ovrhead.
So if the functionality inside is only a small IF clause, then the perform overhead is similar or large than the functionality the IF.
In total you will double the runtime.
But we are talking about microseconds, you have to execute it nearly a million times to notice the effect.
Write FORM which include a functionality which needs at least 10 microseconds.
Siegfried