Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?



In article <3k86utFl4gssU1@xxxxxxxxxxxxxx>,
Pete Dashwood <dashwood@xxxxxxxxxxxxxx> wrote:

[snip]

>Given identical functionality and identical residence, the smaller the code
>is, the quicker it will execute. Invariably.

'Identical residence'? I'm not sure what this represents, Mr Dashwood,
but I'd take exception with your assertion that 'less code = faster
execution' because it appears to ignore differences in the amount of time
it takes to execute different instructions.

I recall, years ago, talking with a Geezer who said that the first
airline reservations system he worked on used only register-to-register
(RR) instructions because they were so fast... in general they found that
rewriting other single instructions as multiple RR instructions still gave
them an overall drop in execution time (commonly known as 'faster code').
Consider the following example.

Using the IBM mainframe platform and every compiler I'm familiar with
since IKFCBL00: given:

05 FLDA PIC X.
05 FLDB PIC X.

then MOVE FLDA TO FLDB will compile to an MVI, IF FLDA = FLDB will compile
to a CLI. Given:

05 FLDA PIC X(n).
05 FLDB PIC X(n).

.... where n is an integer > 1 then MOVE FLDA TO FLDB will compile to an
MVC, IF FLDA = FLDB will compile to a CLC.

As I was taught, lo, those many years ago - and I do not know if this is
still valid for COBOL under modern conditions - an MVI executes
approximately three times faster than an MVC and a CLI thrice faster than
a CLC. It can be readily postulated that code can be written which is
greater in volume of instructions ('larger') than other code ('smaller')
and yet will execute more rapidly due to faster constructs being employed.

DD
.



Relevant Pages

  • Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
    ... > it takes to execute different instructions. ... > instructions because they were so fast... ... > 05 FLDA PIC X. ... > 05 FLDB PIC X. ...
    (comp.lang.cobol)
  • Re: How do you do this?
    ... SwiftForth, VFX, gForth, bigForth, iForth, tforth, win32Forth, ... ANS Forth is too powerful to execute from an untrusted source without ... So one could also compile the code with optimization ...
    (comp.lang.forth)
  • How do you do this?
    ... and read and execute each Forth word. ... So one could also compile the code with optimization ... executed by the worker system. ...
    (comp.lang.forth)
  • Re: Bytecode
    ... Bytecode systems have various advantages. ... but the compression has both ... And it's very simple to compile ... execution tokens and a lookup table, and then execute or compile. ...
    (comp.lang.forth)
  • Re: An Observation
    ... Parse a word from the input stream and leave the ASCII value of its ... Quote a character so it's data, not the name of a word. ... The first part is in a pidgin in which no words execute at compile time. ...
    (comp.lang.forth)