Re:Delphi 7 vs. Kylix3
zeljko,
The various comments you've made in this thread make me think you are benchmarking using
visual output, and therefore simply are only measuring how slow CLX is.
From my experience I can tell you that Kylix compiled code is actually faster than Delphi one,
the main reason being the quite {*word*99}py Delphi memory manager (where Kylix simply calls malloc()).
Here is a very simple benchmark:
---------------------
program speedtest;
{$IFDEF fpc}
{$mode Delphi}
{$threading on}
{$ELSE}
{$APPTYPE Console}
{$ENDIF}
uses
SysUtils, Classes
{$IFDEF fpc}
{$IFDEF unix}
,linux,cthreads
{$ELSE}
,Windows
{$ENDIF}
{$ELSE}
{$IFDEF linux}
,Libc
{$ELSE}
,Windows
{$ENDIF}
{$ENDIF}
;
function getuptime: integer;
{$IFDEF LINUX}
var
si: TSysInfo;
{$ENDIF}
begin
{$IFNDEF LINUX}
result := gettickcount div 1000;
{$ELSE}
sysinfo(si);
result := si.uptime;
{$ENDIF}
end;
function dosomething(bla:integer):string;
begin
result:=inttostr(bla*3434*123*bla);
end;
var starttime:integer;
sl:TStringList;
i,j,k:integer;
t:string;
begin
ismultithread:=true;
starttime:=getuptime;
sl:=TStringList.Create;
for i:=0 to 100 do
begin
t:='';
sl.clear;
write('.');
for j:=0 to 100 do
begin
for k:=0 to 50 do
begin
t:=t+dosomething(k);
sl.add(t);
end;
end;
end;
writeln;
writeln(getuptime-starttime,' seconds');
end.
---------------------
This program will compile with:
- Delphi/Windows
- Kylix/Linux
- FPC/Windows
- FPC/Linux
I know it's a pretty sucky benchmark, as it will mostly measure the speed of the memory manager,
but oh well.
Compiled with Delphi/Kylix default release options, and with FPC switched to best optimizations,
here are my results:
Delphi/Windows: 47 seconds
FPC/Windows: 35 seconds
(Linux tests run on a different Box, so Linux<->Windows results aren't comparable. However the Windows box
is a 2.5GHz P4, where the Linux one is a 2Ghz P4)
Kylix/Linux: 29 seconds
FPC/Linux: 53 seconds.
Of course this benchmark is nowhere near a real-life scenario, but together with my experience I can
only say: If your application is hundreds of percents slower running under Linux, then there is something
really wrong with it.
Simon