‎2010 Aug 13 2:57 AM
Hi Experts
We have a program which has a loop inside which; in order to optimize the performance,
we have used read statements with Binary Search after sorting the internal tables.
The code inside the loop contains multiple read statements (as mentioned) followed by one BDC and one database Update statement.
When we executed the program by scheduling it in background it took 33000 seconds to execute; which is around 9 hours which is not acceptable.
Mentioned herewith are the findings which might help you to analyze and propose the solution.
1) Records in scope for the program to process : 45000
2) We have also noticed that the time taken for processing a fixed number of records increases gradually with the passage of time.
for example:
the 1st 100 records executed in 25secs
next 100 records executed in 75secs
the next 100 in 100 secs and ....... the gradual increase continues.
Just for your information sake: there are no select queries inside the loop ... endloop.
Is there any specific reason why the performance is getting progressively degraded?
Kindly provide a solution for optimizing the performance.
Thanks and Regards
Avishek
‎2010 Aug 13 5:24 AM
Hi,
performance issue in your pgm is:
1) Loop statement
2) Read statement
Main reason to take time is updating the table. my suggestion is reduce the data passing to diffrent tables(reduce READ Staements as much as in loop ).
‎2010 Aug 13 5:41 AM
Hello Avishek,
Few questions:
1. I hope you've SORTed the table before using BINARY SEARCH.
2. How did you measure the runtimes of blocks of 100 records each ?
3. Are you directly updating your database table inside the LOOP ? You need to remove the stmt & put it outside of the LOOP.
Not sure if this helps but there are a couple of [blogs|http://www.sdn.sap.com/irj/scn/weblogs?blog=/pub/u/46921] [original link is broken] [original link is broken]; by Siegfried Boes which might interest you.
BR,
Suhas
Edited by: Suhas Saha on Aug 13, 2010 10:11 AM
‎2010 Aug 13 7:34 AM
Hi Avishek
Is it possible for you to post the contents of the code within the LOOP....ENDLOOP?
Will be difficult to comment anything without having a look at the code if there are really no Select statements within and any direct hits on the database tables.
Regards,
Harsh
‎2010 Aug 13 10:42 AM