Queston on the profiling tool for COBOL.

OS/VS COBOL, COBOL II, Enterprise COBOL for z/OS. OpenCOBOL and OOCobol.
Post Reply
Sai Patel
New Member
Posts: 5
Joined: Thu Apr 23, 2015 10:38 pm

Queston on the profiling tool for COBOL.

Post 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?
User avatar
Robert Sample
Global Moderator
Global Moderator
Posts: 1895
Joined: Fri Jun 28, 2013 1:22 am
Location: Dubuque Iowa
United States of America

Re: Queston on the profiling tool for COBOL.

Post 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.
Sai Patel
New Member
Posts: 5
Joined: Thu Apr 23, 2015 10:38 pm

Re: Queston on the profiling tool for COBOL.

Post by Sai Patel »

Thanks Robert.
Post Reply

Create an account or sign in to join the discussion

You need to be a member in order to post a reply

Create an account

Not a member? register to join our community
Members can start their own topics & subscribe to topics
It’s free and only takes a minute

Register

Sign in

Return to “IBM COBOL, GnuCOBOL (OpenCOBOL), OOCobol.”