Page 1 of 1

Queston on the profiling tool for COBOL.

Posted: Fri Jun 12, 2015 3:50 pm
by Sai Patel
Continuing from this thread at: http://www.zmainframes.com/viewtopic.php?f=10&t=1343 but have a differnt question:
In general, COBOL tuning involves looking at where the code is taking the most time and identifying how to reduce the time used there. Programs are either CPU-bound or I/O-bound (that is, the code mostly waits for CPU time to continue or waits for I/O to complete to continue). With an I/O-bound program, you have to look at how to reduce I/O (such as building tables in memory instead of reading from a file). With a CPU-bound program, you have to look at how to reduce the program code being executed (which may require changing the algorithm, changing variable definitions, or making other efficiency changes). Whether the program is CPU-bound or I/O-bound, using a code profiler can assist in determining where the bottlenecks are in the code.
As Robert has said above, "With an I/O-bound program, you have to look at how to reduce I/O (such as building tables in memory instead of reading from a file)" but if pick up this example, will it not increase the load on the COU? While later we talk about reducing CPU,so is like striking the balance between the two?

Re: Queston on the profiling tool for COBOL.

Posted: Fri Jun 12, 2015 7:02 pm
by Robert Sample
If the program is I/O-bound, then yes making some changes can increase the CPU usage. HOWEVER, the overall elapsed time the program runs will go down because the CPU time is not the critical path in an I/O-bound program (the I/O is). Many times people say they want to decrease the CPU time of a program when they mean they want to decrease the elapsed time of the program. It is essential in tuning projects to understand what the goal is (reduce CPU time? reduce I/O? reduce elapsed time? These are the most common), and not just assume you want to cut CPU consumption, as the goals will help drive the changes that are possible as well as define what makes sense to change. Broadly, the goal is usually to reduce the time the program takes to run, and reducing CPU usage in a program that is I/O-bound will NOT have any impact on the overall elapsed time.

Re: Queston on the profiling tool for COBOL.

Posted: Wed Jun 17, 2015 1:38 pm
by Sai Patel
Thanks Robert.