Pages

Sunday, December 5, 2010

COBOL Performance Tuning - Checking For Disqualifying Events

Today's COBOL Performance Tuning tip is another that can be applied to any language.  You may think it is so obvious that it is not a tip, but common sense.  The only reason I am even giving it a blog entry is because I have seen this happen.

I am positive a request came from a Business Analyst or the customer to not write any extract records for customers with a certain field containing a specific value.  The programmer found the program creating the extract records, found where the call was to write the extract records, and just before that call they inserted an IF statement to go to the paragraph exit if that certain field contained the specific value.

So after the record was read in with the certain field with the specific value, the programmer allowed several more files, tables, history records, etc. to be read in, calculations to occur, calls to be executed and the extract to be completely built before bypassing the customer.

So the tip is, if you have some kind of disqualifying event, check for that event as soon as possible and stop processing any further on that record/file/what ever it is you are processing and go on to the next one.

2 comments:

  1. What happens if the record being filtered is required for something else. Then further analysis would be required. Legacy code could be thousands of lines code. Further analysis maybe be very time consuming. If this was an emergency fix, time maybe an issue.

    ReplyDelete
    Replies
    1. That's one of many things you would have to watch out for. If time is an issue, tuning opportunities are probably not high on your priority list. When I saw this happening for the first time, I wasn't actually looking for it, I just noticed it.

      Delete