[fpc-pascal] Why is cthreads unit not included by default

Mattias Gaertner nc-gaertnma at netcologne.de
Thu Aug 27 18:48:36 CEST 2009


On Thu, 27 Aug 2009 13:46:21 +0200
Mattias Gärtner <nc-gaertnma at netcologne.de> wrote:

>[...]
> I would say, that using cthreads under Linux in an LCL app is ok.
> I didn't test yet a LCL app under OS X, *BSD or Sparc, so  don't
> know if cthreads has a performance penalty there.

I did some tests on OS X and got some interesting results:

An LCL application without cthreads: 15 seconds
An LCL application with cthreads: 13 seconds
An LCL application with cmem: 13 seconds

This means LCL apps get faster with cthreads, while command line
programs get slower.

Under Linux: no difference

procedure TMainForm.FormCreate(Sender: TObject);
var
  s1: String;
  s2: String;
  i: Integer;
  s: String;
begin
  s1:=IntToStr(Paramcount+12345);
  s2:=IntToStr(Paramcount+23456);
  for i:=1 to 500000000 do begin
    s:=s1;
    s:=s2;
  end;
end;

Mattias



More information about the fpc-pascal mailing list