2021 Sep 08 3:37 PM
Dear Experts, Please suggest for the below issue.. I am doing the performance improvement for the custom function module. Function module results are taking different different execution time for the same inputs (plant,storage location, yeare,from date and to date) for the same records(4356) that is some time 15 sec, other times 17sec,5 sec,140 sec etc. Could you please let me know why its taking different execution time for the same inputs and same records :4356. Thanks in advanced. Note : In this FM these tables mkpf and mseg are being used.
2021 Sep 08 3:56 PM
It's a well-known issue that exact same data can lead to different performance because database can be busy or not, application server can be busy or not, the servers may buffer some data and the buffer may have been emptied or not.
The best solution to have the best measure possible is to run two tests consecutively, and take the second test. Of course, you will always get a varying duration. But optimizing the performance should bring you to a noticeable improvement so you don't need the exact duration (if it's more or less 10%, it's not worth spending time on it, unless you have a program running for hours).
2021 Sep 08 3:56 PM
It's a well-known issue that exact same data can lead to different performance because database can be busy or not, application server can be busy or not, the servers may buffer some data and the buffer may have been emptied or not.
The best solution to have the best measure possible is to run two tests consecutively, and take the second test. Of course, you will always get a varying duration. But optimizing the performance should bring you to a noticeable improvement so you don't need the exact duration (if it's more or less 10%, it's not worth spending time on it, unless you have a program running for hours).
2021 Sep 09 10:59 AM
If your program is like this, it would explain it.
data(i) = random_number_between_1_and_4( ).
case i.
when 1.
wait up to 15 seconds.
when 2.
wait up to 17 seconds.
when 3.
wait up to 5 seconds.
when 4.
wait up to 140 seconds.
endcase.
select...
The point is, without you showing the important parts of your code, we cannot possibly tell you why it's not working as you'd like.