I decided to conduct a little performance research: UniDAC (5.0.1) vs FireDAC (8.0.1), on Delphi XE3. Databases: Firebird, MySQL & SQL Server.
Here are the 150k records fetch results (memory usage was considered as the difference between before and after fetching).
Firebird:
CREATE TABLE TEST_PERF (
ID INTEGER PRIMARY KEY,
VC VARCHAR(200),
NM NUMERIC(18,2),
DT TIMESTAMP
)
UniDAC - 0,909 seconds, ate 12 324 044 of memory
FireDAC - 0,967 seconds, ate 282 179 668 of memory (I'm shocked)
MySQL:
CREATE TABLE TEST_PERF (
ID INTEGER PRIMARY KEY,
VC VARCHAR(200),
NM NUMERIC(18,2),
DT DATETIME
)
UniDAC - 0,363 seconds and 11 552 604 of memory
FireDAC - 0,713 seconds and 49 375 108 of memory
SQL Server:
CREATE TABLE TEST_PERF (
ID INTEGER PRIMARY KEY,
VC VARCHAR(200),
NM NUMERIC(18,2),
DT DATETIME
)
UniDAC - 0,391 seconds and 14 155 576 of memory
FireDAC - 0,324 seconds and 51 775 844 of memory
Everything was measured simply:
function MemoryUsed: Cardinal;
var
st: TMemoryManagerState;
sb: TSmallBlockTypeState;
begin
GetMemoryManagerState(st);
Result := st.TotalAllocatedMediumBlockSize + st.TotalAllocatedLargeBlockSize;
for sb in st.SmallBlockTypeStates do
Result := Result + sb.UseableBlockSize * sb.AllocatedBlockCount;
end;
UniQuery1.SQL.Text := 'select * from test_perf';
UniQuery1.SpecificOptions.Values['FetchAll'] := 'True';
mem := MemoryUsed;
tc := Now;
UniQuery1.Open;
UniQuery1.Last;
tc := Now - tc;
mem := MemoryUsed - mem;
Memo1.Lines.Add('UniDAC Firebird: Time: ' + FloatToStr(tc * 24 * 60 * 60) + ' sec; Memory used: ' + IntToStr(mem));
ADQuery1.SQL.Text := 'select * from test_perf';
ADQuery1.FetchOptions.Mode := fmAll;
mem := MemoryUsed;
tc := Now;
ADQuery1.Open;
ADQuery1.Last;
tc := Now - tc;
mem := MemoryUsed - mem;
Memo1.Lines.Add('FireDAC Firebird: Time: ' + FloatToStr(tc * 24 * 60 * 60) + ' sec; Memory used: ' + IntToStr(mem));
If anyone is interested, here is the test application, you can add there performance comparison for ADO, dbExpress, ZeosLib, and others you are interested in.