Portal | Manuals | References | Downloads | Info | Programs | JCLs | Master the Mainframes
IBM Mainframe Computers Forums Index
 
Register
 
IBM Mainframe Computers Forums Index Mainframe: Search IBM Mainframe Forum: FAQ Memberlist Usergroups Profile Log in to check your private messages Log in
 

 

How to reduce the MIPS Consumption in PL/1 Code

 
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler
View previous topic :: :: View next topic  
Author Message
babuprasad.g

New User


Joined: 20 Apr 2007
Posts: 1
Location: Denmark

PostPosted: Thu Aug 06, 2009 11:05 pm    Post subject: How to reduce the MIPS Consumption in PL/1 Code
Reply with quote

Hi,

How can we reduce the MIPS Consumption in PL/1 & DB2 Code.What are the possible ways to reduce atleast 0.5 %.


Best Regards
Back to top
View user's profile Send private message

dick scherrer

Site Director


Joined: 23 Nov 2006
Posts: 19270
Location: Inside the Matrix

PostPosted: Thu Aug 06, 2009 11:34 pm    Post subject:
Reply with quote

Hello and welcome to the forum,

Reduce the number of instructions executed.

Reduce the number of rows processed.

Use proper numeric definitions.

Talk with your performance measurement people and see if there is a tool in use that will identify which parts of the code use the most cpu time.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1017
Location: Oostende, Belgium

PostPosted: Thu Aug 06, 2009 11:35 pm    Post subject:
Reply with quote

Use a better algorithm, cache values retrieved from DB2, get rid of all "conversion will be done by library call" warnings, use fixed bin(31) for loops and not PICs. Remove invariant code from loops.

But most importantly, use better algorithms!
Back to top
View user's profile Send private message
MBabu

Active User


Joined: 03 Aug 2008
Posts: 401
Location: Mumbai

PostPosted: Fri Aug 07, 2009 1:13 am    Post subject: Reply to: How to reduce the MIPS Consumption in PL/1 Code
Reply with quote

As Dick and Prino alluded to, try to avoid data type conversions. For math operations, use the same data types. Whenever possible avoid float and packed types unless the data you are working with is already in that format. Maybe I should restrict that to say use FIXED BIN for all program control, indices, etc.

The same thing goes for Character operations. Avoid unnecessary conversions from numeric to character types. Find the most efficient means to do things like concatenation. Sometimes that means writing a small, specialized assembler routine to do something common.

Compile without runtime checks where appropriate.

Avoid external library calls when possible, at least for trivial tasks.

Cache data in memory rather than make repetitive reads.

And as has already been said several times, before you do any of this, see if your algorithm can be improved. It doesn't matter how you use a programming language if the algorithm is bad.
Back to top
View user's profile Send private message
Robert Sample

Global Moderator


Joined: 06 Jun 2008
Posts: 8055
Location: East Dubuque, Illinois, USA

PostPosted: Fri Aug 07, 2009 2:39 am    Post subject:
Reply with quote

Quote:
How can we reduce the MIPS Consumption in PL/1 & DB2 Code.What are the possible ways to reduce atleast 0.5 %.
Misconception number one: you want to reduce CPU consumption (presumably) since MIPS is (a) not typically referenced for individual programs, and (b) not a very good way to measure since it typically is not available without using specialized tools. And note that even when IBM was using MIPS, the workload being measured included cpu usage, input/output to disk and tape, and otherwise represented the entire machine -- not just CPU time.

Misconception number two: reducing the CPU time 0.5% is worth taking the time to look at. Unless the job is taking a lot of CPU time (i.e., running for literally days not hours at a time), you're not going to save enough time to make any significant difference.
Back to top
View user's profile Send private message
prino

Senior Member


Joined: 07 Feb 2009
Posts: 1017
Location: Oostende, Belgium

PostPosted: Fri Aug 07, 2009 2:49 pm    Post subject:
Reply with quote

Change of algorithm, executed statements:

Code:
NAT_SCAN 481,904,272  97.2656% - original algorithm
NAT_SCAN      74,634   0.4819% - new algorithm


No amount of fiddling using the old algorithm would have allowed the original code to come even close to using a new algorithm...
Back to top
View user's profile Send private message
View previous topic :: :: View next topic  
Post new topic   Reply to topic    IBMMAINFRAMES.com Support Forums -> PL/I & Assembler All times are GMT + 6 Hours
Page 1 of 1

 

Search our Forum:

Similar Topics
Topic Author Forum Replies Posted
No new posts Job failing with USER = 4093 REASON C... Pradeepa S ABENDS & Debugging 1 Wed May 17, 2017 3:35 pm
No new posts COBOL Code Parsers and Lineage Establ... balimanja COBOL Programming 2 Tue May 02, 2017 3:30 am
No new posts Cobol upgrade - source code missing f... gthmrj IBM Tools 1 Wed Apr 26, 2017 6:04 pm
No new posts MIPS/CPU consumption reduction in Batch vishwakotin DFSORT/ICETOOL 4 Sat Mar 18, 2017 5:46 pm
No new posts JCL to Set Return code based on DB2 S... vinu78 DB2 17 Mon Mar 13, 2017 9:47 pm


Facebook
Back to Top
 
Mainframe Wiki | Forum Rules | Bookmarks | Subscriptions | FAQ | Tutorials | Contact Us