Re: I need the fastest routine
- From: "Rudy Velthuis [TeamB]" <newsgroups@xxxxxxxxxxxx>
- Date: Sat, 5 Jul 2008 20:22:13 +0200
Nenad Trkulja wrote:
<snip>
begin
if (aArray[n] < aMin) or (aArray[n+1] < aMin) or
(aArray[n+2] < aMin) or (aArray[n+3] < aMin) then
begin
if aArray[n] < aMin then
aMin := aArray[n];
if aArray[n+1] < aMin then
aMin := aArray[n+1];
if aArray[n+2] < aMin then
aMin := aArray[n+2];
if aArray[n+3] < aMin then
aMin := aArray[n+3];
end;
<snip>
That looks real cool, but is actually slightly slower than the code
Stig or I posted. I don't quite understand why you think that dividing
the array in 4 will make the code faster. The loop will be shorter, but
checking the loop variable is negligible compared to the comparisons
done in the loop.
I'll post my test to .attachments.
--
Rudy Velthuis [TeamB] http://www.teamb.com
"Basically, I no longer work for anything but the sensation I
have while working."
-- Albert Giacometti (sculptor)
.
- Follow-Ups:
- Re: I need the fastest routine
- From: Nenad Trkulja
- Re: I need the fastest routine
- From: Dan Downs
- Re: I need the fastest routine
- References:
- I need the fastest routine
- From: Clément Doss
- Re: I need the fastest routine
- From: Nenad Trkulja
- 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
|