Subject | Firebird on Linux 300% slower than XP??? |
---|---|
Author | Luciano Enzweiler |
Post date | 2004-03-20T22:51:27Z |
I must be doing something wrong, but I can't figure out what. I'll describe the problem shortly and then more detailed.
Thanks in advance!
Shortly:
I have Firebird installed both on Windows XP and Linux, but its 3 times slower on Linux compared to XP!!! As I couldn't believe it (I thought it should be as fast or faster on Linux), I developed a piece of software (I have the sources and can send if anyone wants) to test Firebird on Delphi7/Kylix3 CLX. The results just proved what I was "feeling" on my customers, Linux was much slower than Windows:
*With the TSQLQuery component a SELECT statement was 3 times slower on Linux, while an UPDATE statement performed as fast as on Windows (that's OK, but the only one).
*With the TClientDataSet (and a TDataSetProvider linked to that TSQLQuery) it was 400% (!!!) slower on Linux testing both with a SELECT and an UPDATE (with ApplyUpdates). Some may say: "Of course using a clientdataset is slower because it stores the data and.". Yes, but though the SELECT, comparing Clientds to the query is 5 times slower (both on Linux and Windows), the UPDATE is much faster (almost 20 times).
Anyway on all the tests (but the UPDATE with the query), the performance is much slower on Linux than on Windows and I am almost sure it is Firebird, because the "code" takes the same time to run on both OS.
Does anyone else noticed it? Is it normal?
Mode Details:
Characteristics:
*Computer: AthonXP 1600+ 512MB RAM;
*Windows XP SP1, with Firebird 1.5.0.4201_RC8. I didn't change any of the default settings. The test software was compiled on Delphi7 CLX;
*Linux RedHat 8, with FirebirdSS-1.5.0.4290-0. I didn't change any of the default settings either. The test software was compiled on Kylix 3 with exactly the same source as on XP;
*I created a Database to this test with 3 tables, the main one with 2000 records and the other two with 3 records each (to test JOINS);
I ran all the tests 3 times or more and made an average. I also made it with different SQL statements, some with JOIN some querying more records and though it made differences between the queries, the comparison between XP and Linux (what matters) remained almost the same (Linux slower.).
Here is an sample of the code I used to make the test (I also used a lot of others, with the same result)
**********START********
qryGeral1.SQL.Clear;
qryGeral1.SQL.Add('SELECT C.CDCLIENTE, C.NOME FROM CLIENTE C WHERE C.CDCLIENTE = :CDCLIENTE');
Alt := False;
for K := 1 to 1000 do begin
if Alt then begin
qryGeral1.Params.ParamByName('CDCLIENTE').AsInteger := 153;
end else begin
qryGeral1.Params.ParamByName('CDCLIENTE').AsInteger := 1485;
end;
Alt := not Alt;
qryGeral1.Params.ParamByName('CDCLIENTE').AsInteger := 153;
qryGeral1.Close;
GetStartTime; // --- Here is a function where I start to count the time
qryGeral1.Open;
GetEndTime; // --- The end. So I know how long it took to execute this line 1000 times.
end;
**********END*******
Most of the tests took between 0.5 and 2 seconds, with enough time to have a good comparison. I also tested the same software on Win98 (around twice slower than XP, but yet faster than Linux) and with Linux Conectiva 9 (with the same results as Red Hat 8). As I made the tests several times and in many different ways trying to isolate the DB part, I guess there isn't anything wrong with this conclusion.
I just hope that I'm missing a configuration or something to make it faster. I really don't feel like installing the DB server on XP on a customer I just installed the server and all clients with Linux :-) Please help me!!! :-)
Thanks you all.
Luciano Enzweiler
[Non-text portions of this message have been removed]
Thanks in advance!
Shortly:
I have Firebird installed both on Windows XP and Linux, but its 3 times slower on Linux compared to XP!!! As I couldn't believe it (I thought it should be as fast or faster on Linux), I developed a piece of software (I have the sources and can send if anyone wants) to test Firebird on Delphi7/Kylix3 CLX. The results just proved what I was "feeling" on my customers, Linux was much slower than Windows:
*With the TSQLQuery component a SELECT statement was 3 times slower on Linux, while an UPDATE statement performed as fast as on Windows (that's OK, but the only one).
*With the TClientDataSet (and a TDataSetProvider linked to that TSQLQuery) it was 400% (!!!) slower on Linux testing both with a SELECT and an UPDATE (with ApplyUpdates). Some may say: "Of course using a clientdataset is slower because it stores the data and.". Yes, but though the SELECT, comparing Clientds to the query is 5 times slower (both on Linux and Windows), the UPDATE is much faster (almost 20 times).
Anyway on all the tests (but the UPDATE with the query), the performance is much slower on Linux than on Windows and I am almost sure it is Firebird, because the "code" takes the same time to run on both OS.
Does anyone else noticed it? Is it normal?
Mode Details:
Characteristics:
*Computer: AthonXP 1600+ 512MB RAM;
*Windows XP SP1, with Firebird 1.5.0.4201_RC8. I didn't change any of the default settings. The test software was compiled on Delphi7 CLX;
*Linux RedHat 8, with FirebirdSS-1.5.0.4290-0. I didn't change any of the default settings either. The test software was compiled on Kylix 3 with exactly the same source as on XP;
*I created a Database to this test with 3 tables, the main one with 2000 records and the other two with 3 records each (to test JOINS);
I ran all the tests 3 times or more and made an average. I also made it with different SQL statements, some with JOIN some querying more records and though it made differences between the queries, the comparison between XP and Linux (what matters) remained almost the same (Linux slower.).
Here is an sample of the code I used to make the test (I also used a lot of others, with the same result)
**********START********
qryGeral1.SQL.Clear;
qryGeral1.SQL.Add('SELECT C.CDCLIENTE, C.NOME FROM CLIENTE C WHERE C.CDCLIENTE = :CDCLIENTE');
Alt := False;
for K := 1 to 1000 do begin
if Alt then begin
qryGeral1.Params.ParamByName('CDCLIENTE').AsInteger := 153;
end else begin
qryGeral1.Params.ParamByName('CDCLIENTE').AsInteger := 1485;
end;
Alt := not Alt;
qryGeral1.Params.ParamByName('CDCLIENTE').AsInteger := 153;
qryGeral1.Close;
GetStartTime; // --- Here is a function where I start to count the time
qryGeral1.Open;
GetEndTime; // --- The end. So I know how long it took to execute this line 1000 times.
end;
**********END*******
Most of the tests took between 0.5 and 2 seconds, with enough time to have a good comparison. I also tested the same software on Win98 (around twice slower than XP, but yet faster than Linux) and with Linux Conectiva 9 (with the same results as Red Hat 8). As I made the tests several times and in many different ways trying to isolate the DB part, I guess there isn't anything wrong with this conclusion.
I just hope that I'm missing a configuration or something to make it faster. I really don't feel like installing the DB server on XP on a customer I just installed the server and all clients with Linux :-) Please help me!!! :-)
Thanks you all.
Luciano Enzweiler
[Non-text portions of this message have been removed]