On Sun, 22 Apr 2012 08:14:11 -0500, "HeyBub" <[email protected]> wrote:
>Nomen Nescio wrote: >> >> These aren't "microscopic optimizations" but something easy to do >> that every programmer should be aware of. It doesn't take longer to >> do things right the first time. >> >>> If you worked for me, I'd fire you for wasting my money. >> >> Don't flatter yourself. You couldn't find your ass with both hands >> much less fire anybody. > >Show me. Supply some sample code comparing a PERFORM to a GO TO. > >It will be easy enough to stick timers in the code for a million (or a >billion) iterations. > >So, I say again, show me that the difference is significant, or even >measurable. > In a program with heavy use of PERFORM where the compiler has to assume that execution can fall through to the next instruction at the exit point rather than always return to the instruction following the PERFORM, it could make a modest difference. Nomen and Fritz both seem to be coding based on how the IBM 370 COBOL VS compiler worked. In most cases even with the 1974 compiler the difference was trivial because the CPU time was a small part of the overall run time. Also the instruction path length was and is far longer for I-O requests and implied or explicitly coded CALL statements, especially if the DYNAM (load the CALLED module at execution time or delayed binding) was chosen. Having said the above, I am confident that I can take any program optimized for the COBOL VS environment and restructure it eliminating GO TO statements and have the resulting program execute with the same or less CPU time. I am assuming that both the before and after versions are compiled with OPTIMIZE. Clark Morris ---------------------------------------------------------------------- For IBM-MAIN subscribe / signoff / archive access instructions, send email to [email protected] with the message: INFO IBM-MAIN

