Tips for cobol performance tuning



Support for OS/VS COBOL, VS COBOL II, COBOL for OS/390 & VM and Enterprise COBOL for z/OS

Tips for cobol performance tuning

Postby hvats83 » Mon Dec 05, 2011 12:04 pm

Please provide some general techniques used to optimize a cobol code
hvats83
 
Posts: 18
Joined: Mon Dec 05, 2011 11:57 am
Has thanked: 1 time
Been thanked: 0 time

Re: Tips for cobol performance tuning

 

Re: Tips for cobol program performance tuning

Postby BillyBoyo » Mon Dec 05, 2011 1:07 pm

This is such a general question, I don't believe there can be much of an answer to it. Either

  1. Don't bother because you'll probably not notice the difference
  2. Identify the part(s) of the program performing badly and fix the logic
  3. There are always three things

If you can give a fuller explanation of what you are looking for, there might be better answers.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Tips for cobol program performance tuning

Postby Anuj Dhawan » Mon Dec 05, 2011 1:12 pm

Start from here: https://www-304.ibm.com/support/docview ... wg27001475" onclick="window.open(this.href);return false;

And here: COBOL Performance Tuning Tips
Anuj
Anuj Dhawan
 
Posts: 274
Joined: Mon Feb 25, 2008 3:53 am
Location: Mumbai, India
Has thanked: 6 times
Been thanked: 4 times

Re: Tips for cobol program performance tuning

Postby BillyBoyo » Mon Dec 05, 2011 2:44 pm

I'll restate my points:

  1. If your code is well-written with regard to implementing the requirement, then you will not notice much difference once the code is "tuned"
  2. If your code is badly-written (but still producing the correct output) write the code better to continue producing the correct output
  3. Hi Akatsukami!

If you there is something which requires real tuning, it is probably not a task for a beginner (except as an exercise, I suppose).

You have to judge the amount of time spent on the tuning/testing against the gain (which you have to fully understand the terms of). Most of the recommendations in the document for which Anuj has provided a link are for CPU-usage reduction. If you task is I/O-bound, it won't help much.

The biggest jump in reduction of CPU (after fixing any bad ways to do something, ie the "badly-written" above) will be to specify the compiler option OPTimise. The biggest jump in reduction of I/O (after fixing any bad ways to do something, ie the "badly-written" above) will likely be in the definition of the datasets/JCL.

Don't go off on your own and "tune" a program from the above document, unless it is an entirely learning-related task.
BillyBoyo
Global moderator
 
Posts: 3804
Joined: Tue Jan 25, 2011 12:02 am
Has thanked: 22 times
Been thanked: 264 times

Re: Tips for cobol program performance tuning

Postby Robert Sample » Mon Dec 05, 2011 5:43 pm

First and foremost, unless there is some reason to think the code is not performing well, DO NOT OPTIMIZE IT!

Second, if you don't know the difference between I/O-bound and CPU-bound programs, there's no point in you attempting to optimize anything.

Third, with the level of optimization the compiler does these days, unless you change the algorithm in some way, there's little you can do that will materially affect the program's running. So unless you've got a mandate to pull the program apart and put it back together, optimization is not a solution.
Robert Sample
Global moderator
 
Posts: 3367
Joined: Sat Dec 19, 2009 8:32 pm
Location: East Dubuque, Illinois
Has thanked: 1 time
Been thanked: 222 times

Re: Tips for cobol program performance tuning

Postby Ed Goodman » Mon Dec 05, 2011 9:34 pm

#1: Get a definition of "tuning"
What are you trying to reduce? Is it CPU time, is it run time, is it EXCP counts?

#2: Find a way to measure the factors produced by answering #1

#3: Run a set of measurements over a long time, say several months, to see which programs are actually using a lot of (items from #1)

#4: Then, and only then, start figuring out how to improve the performance of those programs identified in #3.
Ed Goodman
 
Posts: 342
Joined: Thu Feb 24, 2011 12:05 am
Has thanked: 3 times
Been thanked: 17 times

Re: Tips for cobol program performance tuning

Postby dick scherrer » Mon Dec 05, 2011 11:25 pm

Hello,

I believe that what many want to call "tuning" is really based on extremely poor design and is beyond tuning. . .

The way to improve the performance of these "resource hogs" is to redesign the process (usually quite unattractive).
Hope this helps,
d.sch.
User avatar
dick scherrer
Global moderator
 
Posts: 6304
Joined: Sat Jun 09, 2007 8:58 am
Has thanked: 3 times
Been thanked: 91 times


Return to IBM Cobol

 


  • Related topics
    Replies
    Views
    Last post