Re: Automatically transform or expand do loop in a subroutine
- From: "Dr Ivan D. Reid" <Ivan.Reid@xxxxxxxxxxxx>
- Date: Thu, 31 Jan 2008 20:08:12 +0000 (UTC)
On Wed, 30 Jan 2008 23:25:01 -0800, Richard Maine <nospam@xxxxxxxxxxxxx>
wrote in <1ibjyb7.1hw8i1tx9pokqN%nospam@xxxxxxxxxxxxx>:
highegg <highegg@xxxxxxxxx> wrote:
On Jan 31, 7:06 am, nos...@xxxxxxxxxxxxx (Richard Maine) wrote:
yaqi <yaqiw...@xxxxxxxxx> wrote:
I want to save computing time as much as I can.
...
do i=1,d
c = c + i
end do
The "obvious" way to save a lot of computing time here is to replace the
loop with
c = c + d*i
certainly not. c = c + d*(d+1)/2, more likely :)
Um. Er. Right.
I remember getting a fairly righteous reply from Jerry Pournelle
back in the late 80s when I pointed out to him that his "Benchmark of
Sorts" (or some such phrase) in BYTE at the time turned out to be exactly
that, and using the transform brought the "benchmark" down fron something
like a few minutes to 1/40 sec on a PC/AT[1]. The essence of the reply
was, "That's not the point"!
[1] It may have been even more drastic. Short of hunting through all my
archives, my memory's the only resource I've got.
--
Ivan Reid, School of Engineering & Design, _____________ CMS Collaboration,
Brunel University. Ivan.Reid@[brunel.ac.uk|cern.ch] Room 40-1-B12, CERN
KotPT -- "for stupidity above and beyond the call of duty".
.
- Follow-Ups:
- Re: Automatically transform or expand do loop in a subroutine
- From: Richard Maine
- Re: Automatically transform or expand do loop in a subroutine
- References:
- Automatically transform or expand do loop in a subroutine
- From: yaqi
- Re: Automatically transform or expand do loop in a subroutine
- From: Richard Maine
- Re: Automatically transform or expand do loop in a subroutine
- From: highegg
- Re: Automatically transform or expand do loop in a subroutine
- From: Richard Maine
- Automatically transform or expand do loop in a subroutine
- Prev by Date: Re: Automatically transform or expand do loop in a subroutine
- Next by Date: Re: Automatically transform or expand do loop in a subroutine
- Previous by thread: Re: Automatically transform or expand do loop in a subroutine
- Next by thread: Re: Automatically transform or expand do loop in a subroutine
- Index(es):
Relevant Pages
|