MVSFORUMS.com Forum Index MVSFORUMS.com
A Community of and for MVS Professionals
 
 FAQFAQ   SearchSearch   Quick Manuals   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Regarding Initialization

 
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming
View previous topic :: View next topic  
Author Message
kirank
Beginner


Joined: 21 Apr 2004
Posts: 61
Topics: 33
Location: hyderabad

PostPosted: Tue Apr 08, 2008 11:42 pm    Post subject: Regarding Initialization Reply with quote

Hi,

We are working on a requirement where we need to reduce the cpu consuming time of a program. The program is taking a long time during Intialization.

The program contians cobol table and the data is loading into the table. Every time when the loop begins(perform para) the variables(all are alphanumeric data type) of the table are getting initialized and that initialization is taking more cpu time. This we found through Strobe report.

After that we just removed initialization and we directly 'moved spaces to group variable' and again tested(This we've done by taking inputs from experts). Surprisingly the cpu consuming time got reduced.

Could you please let me know why this is happened? As per my knowledge it is most comfortable to use Intialization than moving.

Regards,
Kiran.
Back to top
View user's profile Send private message
semigeezer
Supermod


Joined: 03 Jan 2003
Posts: 1014
Topics: 13
Location: Atlantis

PostPosted: Wed Apr 09, 2008 12:40 am    Post subject: Reply with quote

In assembler terms, it is all moves. I'm sure there is some COBOL compiler implementation detail that someone will point out, like initialize does each variable individually, or uses external runtime routines or uses some inefficient storage reference pattern or something similar, but if you really want the answer in this specific case, look at the generated assembler (probably a LIST compiler option - I don't know COBOL, let alone the idiosyncrasies of the compiler). Also, most IBM compilers have a "programmer's guide" that has this type of performance/best practices information. Sometimes it is buried in the language references manuals instead.
_________________
New members are encouraged to read the How To Ask Questions The Smart Way FAQ at http://www.catb.org/~esr/faqs/smart-questions.html.
Back to top
View user's profile Send private message Visit poster's website
haatvedt
Beginner


Joined: 14 Nov 2003
Posts: 66
Topics: 0
Location: St Cloud, Minnesota USA

PostPosted: Thu Apr 10, 2008 4:46 pm    Post subject: Reply with quote

Kirank,

I would suggest that you take the original code and compile it with the "LIST" option to see the generated assembler code. then do the same with the new version. I suspect that the difference is the looping through the table and initializing each field in the table.

a better technique is to modify the program so as to not require the table initialization at all. one way to do this is to check and see if either a SEARCH or SEARCH ALL verb is used. Also you need to check and see if you are doing some type of direct index access. If you're not using direct index access then you can use OCCURS DEPENDING ON variable-name when declaring the table. then add 1 to the variable name when loading the table. (you have to set the variable name to zero instead of initializing the table, also set the index to +1).

I always try to avoid array initialization if possible. This depends on how the table / array is accessed in the program

good luck

ps.. i do performance tuning for a living.
_________________
Chuck Haatvedt

email --> clastnameatcharterdotnet

(replace lastname, at, dot with appropriate
characters)
Back to top
View user's profile Send private message
slade
Intermediate


Joined: 07 Feb 2003
Posts: 266
Topics: 1
Location: Edison, NJ USA

PostPosted: Thu May 15, 2008 10:25 am    Post subject: Reply with quote

Hi Kirank,

If you have to init the table and it's done many times , init a "model" table that is identical to your working table. Then whenever the working table requires an init, move the model table to the working table at the 01 level.

This should reduce a good deal of the o'head.
_________________
Regards, Jack.

"A problem well stated is a problem half solved" -- Charles F. Kettering
Back to top
View user's profile Send private message
Display posts from previous:   
Post new topic   Reply to topic   printer-friendly view    MVSFORUMS.com Forum Index -> Application Programming All times are GMT - 5 Hours
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


MVSFORUMS
Powered by phpBB © 2001, 2005 phpBB Group