so i can optimize functions using different calling conventions?Originally Posted by waran
examples?
edit:
i did some tests,
seems like fastcall or register is the slower ? why ?
[pascal]program Project1;
{$APPTYPE CONSOLE}
uses
SysUtils, Windows;
type
TPoint4 = array[0..3] of Single;
procedure Test1(const a,b : TPoint4);
begin
end;
procedure Test2(const a,b : TPoint4); stdcall;
begin
end;
procedure Test3(const a,b : TPoint4); cdecl;
begin
end;
var
a,b : TPoint4;
c : Cardinal;
n : Int64;
begin
n := 0;
c := GetTickCount;
repeat
Test3(a,b);
Inc(n);
until GetTickCount >= c + 1000;
Writeln(n);
n := 0;
c := GetTickCount;
repeat
Test2(a,b);
Inc(n);
until GetTickCount >= c + 1000;
Writeln(n);
n := 0;
c := GetTickCount;
repeat
Test1(a,b);
Inc(n);
until GetTickCount >= c + 1000;
Writeln(n);
Readln;
end.
[/pascal]
results:
123686244
130016857
59970038
Bookmarks