Re: I need the fastest routine
- From: "Rudy Velthuis [TeamB]" <newsgroups@xxxxxxxxxxxx>
- Date: Sat, 5 Jul 2008 20:14:24 +0200
Rudy Velthuis [TeamB] wrote:
begin
if p^ > aMax then aMax := p^ ;
if p^ < aMin then aMin := p^;
inc(p);
end;
begin
if aArray[I] > aMax then
aMax := aArray[I];
if aArray[I] < aMin then
aMin := aArray[I];
end;
begin
Value := aArray[I];
if Value > aMax then
aMax := Value;
if Value < aMin then
aMin := Value;
end;
end;
I just coded all three versions in one program. Your code and my first
code produce exactly the same machine code. Not one single instruction
is different.
My second variety is a little simpler, but is not measurably faster or
slower.
--
Rudy Velthuis [TeamB] http://www.teamb.com
Fundamentalists: believe 2+2=5 because It Is Written. Somewhere.
They have a lot of trouble on their tax returns.
"Moderate" believers: live their lives on the basis that 2+2=4.
But go regularly to church to be told that 2+2 once made 5, or
will one day make 5, or in a very real and spiritual sense,
should make 5.
"Moderate" atheists: know that 2+2=4 but think it impolite to say
so too loudly as people who think 2+2=5 might be offended.
"Militant" atheists: "Oh for pity's sake. HERE. Two pebbles. Two
more pebbles. FOUR pebbles. What is WRONG with you people?"
.
- Follow-Ups:
- Re: I need the fastest routine
- From: Hubert Seidel
- Re: I need the fastest routine
- References:
- I need the fastest routine
- From: Clément Doss
- Re: I need the fastest routine
- From: Q Correll
- Re: I need the fastest routine
- From: Clément Doss
- Re: I need the fastest routine
- From: Q Correll
- Re: I need the fastest routine
- From: Stig Johansen
- Re: I need the fastest routine
- From: Rudy Velthuis [TeamB]
- I need the fastest routine
- Prev by Date: Re: I need the fastest routine
- Next by Date: Re: I need the fastest routine
- Previous by thread: Re: I need the fastest routine
- Next by thread: Re: I need the fastest routine
- Index(es):
Relevant Pages
|