IBM Mainframe Forum Index
 
Log In
 
IBM Mainframe Forum Index Mainframe: Search IBM Mainframe Forum: FAQ Register
 

How to reduce the MIPS Consumption in PL/1 Code


IBM Mainframe Forums -> PL/I & Assembler
Post new topic   Reply to topic
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
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

Moderator Emeritus


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

PostPosted: Thu Aug 06, 2009 11:34 pm
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: 1306
Location: Vilnius, Lithuania

PostPosted: Thu Aug 06, 2009 11:35 pm
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: 400
Location: Mumbai

PostPosted: Fri Aug 07, 2009 1:13 am
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: 8697
Location: Dubuque, Iowa, USA

PostPosted: Fri Aug 07, 2009 2:39 am
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: 1306
Location: Vilnius, Lithuania

PostPosted: Fri Aug 07, 2009 2:49 pm
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 View Bookmarks
All times are GMT + 6 Hours
Forum Index -> PL/I & Assembler

 


Similar Topics
Topic Forum Replies
No new posts run rexx code with jcl CLIST & REXX 15
No new posts Compile rexx code with jcl CLIST & REXX 6
No new posts Parallelization in CICS to reduce res... CICS 4
No new posts REXX code to expand copybook in a cob... CLIST & REXX 2
No new posts VSAM return code 23 - for a Random read COBOL Programming 4
Search our Forums:

Back to Top