Application Development and Automation Discussions
Join the discussions or start your own on all things application development, including tools and APIs, programming models, and keeping your skills sharp.
cancel
Showing results for 
Search instead for 
Did you mean: 
Read only

PERFORM usage

Former Member
0 Likes
542

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

4 REPLIES 4
Read only

Former Member
0 Likes
511

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

Read only

0 Likes
511

hi Sushil,

I just gave a single IF condition there in my subroutine.

thats all .

Regards

oin

Read only

Former Member
0 Likes
511

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

Read only

Former Member
0 Likes
511

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