Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: "Pete Dashwood" <dashwood@xxxxxxxxxxxxxx>
- Date: Thu, 21 Jul 2005 12:01:29 +1200
"Clark Morris" <cfmtech@xxxxxxxx> wrote in message
news:e1atd11fi2cshuqsgg11l78qp1n840102p@xxxxxxxxxx
> On Tue, 19 Jul 2005 11:02:50 +1200, "Pete Dashwood"
> <dashwood@xxxxxxxxxxxxxx> wrote:
>
>>
<snip>>>
>>2. The less code that is generated, the faster it will run.
>
> Not necessarily.
Yes, necessarily. :-) Three factors affect online performance; two of them
are load time and capture time. The smaller and tighter a module is, the
quicker it loads and it will be likely to require less capture time.
Capture time for a process will be improved if there is less code for the
process to execute (as long as it provides the same functionality, of
course.)
Adding code cannot possibly make it execute any faster than it is required
to. And if everything else is equal, the faster load time of a smaller
module makes overall execution quicker. If a small module is being paged in
and out continually, as opposed to a large resident piece of code, then the
overall execution of the small module functionality may be longer, but that
implies that the large piece of code is doing more (otherwise, why is it so
large?), so the comparison is between apples and oranges
Given identical functionality and identical residence, the smaller the code
is, the quicker it will execute. Invariably.
> Some of the wild optimizations of IBM's mainframe
> COBOL include moving the code for PERFORMed paragraphs inline
> replacing the PERFORM depending on how many places the paragraph is
> PERFORMED from. I am certain that the same exists in other compilers
> for various languages.
And how exactly does that invalidate my statement? :-) If the optimizer
expands code in line then 'less code' is not generated.
If you are thinking that page boundaries could make your statement true,
then that fails as well; shorter code is paged quicker because it occupies
fewer pages...
In modern systems 'locality of reference' is almost irrelevant, especially
when multitasking is proceeding anyway.
Think about it.
<snipped what we agree on... :-)>
Pete
.
- Follow-Ups:
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Chuck Stevens
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Pete Dashwood
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Rick Smith
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: charles hottel
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: docdwarf
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- References:
- Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Oliver Wong
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Oliver Wong
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: docdwarf
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Chuck Stevens
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: docdwarf
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Oliver Wong
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Pete Dashwood
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Howard Brazee
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Pete Dashwood
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Michael Mattias
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Pete Dashwood
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Howard Brazee
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Pete Dashwood
- Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- From: Clark Morris
- Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- Prev by Date: "Shared" procedure division code
- Next by Date: Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- Previous by thread: Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- Next by thread: Re: Is it always possible to write a COBOL program using only 1 sentence per paragraph?
- Index(es):
Relevant Pages
|