The new scores are:
953ms for my Delphi code
about 350-410ms for ASM - your code (your ASM code is a little bit
difficult to measure because its execution time varies in a higher range)
I have a question: I should consider the lowest time measured or the
average?
procedure TForm1.Button5Click(Sender: TObject);
VAR a,b,c,big,i: integer;
T: Cardinal;
begin
Label7.Caption:= '';
for big:= 1 to 10 DO
begin
a:= random(1000);
b:= random(1000);
c:= random(1000);
T:= GetTickCount;
for i:= 1 to 90000000 DO { 100 milioane }
Max3(a, b, c);
Label7.Caption:= IntToStr(GetTickCount-T);
Label7.Refresh;
end;
end;
Wilfried Mestdagh wrote:
> Hello,
>
> Oeps I wrote a bug in the Max3. This one is better:
>
> function Max3(a, b, c: integer): integer;
> asm
> cmp eax, edx
> jl @less
> mov edx, ecx
> jmp @again
> @less:
> mov eax, ecx
> @again:
> cmp eax, edx
> jl @done
> ret
> @done:
> mov eax, edx
> end;
>
> ---
> Rgds, Wilfried
> http://www.mestdagh.biz
>
> _______________________________________________
> Delphi mailing list -> [email protected]
> http://www.elists.org/mailman/listinfo/delphi
>
>
_______________________________________________
Delphi mailing list -> [email protected]
http://www.elists.org/mailman/listinfo/delphi