|
> So, does the RPG compiler optimize the executable? Or is that either not > possible, or an additional step I need to perform? The default is for no (or as close to "no" as the AS/400 goes) optimization. I would suggest that you develop and test with this setting for reasons I'll cover in a moment. Once the program needs to move into production you can either recompile and specify a higher level or (safer) simply use CHGPGM and change the optimization level. > If the RPG compiler > doesn't optimize my code, then it is a non issue and I can go ahead and > compile with *ALL (since there is practically no size increase over *LIST). This is probably a good time to point out that there is very little difference in ability to step though a program regardless of what level of optimization you use. I've never tried it, but I guess in theory the dead code elimination process could cause you to step from line 21 to line 23 (apparently) skipping line 22 and things like this but it is not a practical consideration to my mind. You'll know when this happens while setting debug points as when you point at the source line and press F6 - if that line is not "debugable" then the system just sets a break at next line that is. Of more concern is the ability to display and change variables. at higher levels of optimization when you display a variable you may not be seeing the current value. This is due to "register" optimization which has caused the variables storage location to not yet be updated. I believe a similar process works in reverse when you change a variable in debug. If a copy is already in a "register" then your modified value will not be used. In fact I think at some levels it will not even let you change the variable. > And this CPROBJ (which I have never used before, nor heard of). Does > that just remove the debugging information? Or is that what actually does > the optimization? Optimization is done by CHGPGM or CRTPGM. CPROBJ can be used against most any AS/400 object, look at the help for the command to what it does for each type of object. In the case of *PGM and *SRVPGM objects it compresses the observability information (and I guess debug information in the case of ILE programs). If you were a software vendor and wanted to remove debug and/or observability - then you can use CHGPGM to remove either or both. There is really no point in removing observability IMHO but some do it anyway (out of habit since in the case of OPM programs debug and observability are the same thing ?). In the case of ILE programs they are separate and it is possible to remove one without removing the other. Let me stress again that debug and observability information are never a performance consideration. They do not affect program execution, only physical DASD storage is involved here. +--- | This is the Midrange System Mailing List! | To submit a new message, send your mail to MIDRANGE-L@midrange.com. | To subscribe to this list send email to MIDRANGE-L-SUB@midrange.com. | To unsubscribe from this list send email to MIDRANGE-L-UNSUB@midrange.com. | Questions should be directed to the list owner/operator: david@midrange.com +---
As an Amazon Associate we earn from qualifying purchases.
This mailing list archive is Copyright 1997-2024 by midrange.com and David Gibbs as a compilation work. Use of the archive is restricted to research of a business or technical nature. Any other uses are prohibited. Full details are available on our policy page. If you have questions about this, please contact [javascript protected email address].
Operating expenses for this site are earned using the Amazon Associate program and Google Adsense.