I´m declaring MidasLib to avoid dll hell caused by Midas.dll in some clients.
The code below runs in about 2350ms. If I remove the MidaLib declaration in uses it starts to run in just 45ms!!
The data.xml file was saved with TClientDataSet.SaveToFile method, has 5000 records and its size is about 600Kb.
Does anybody knows how to explain this weird behavior?
I can confirm the problem in Delphi XE2 upd 3 and in Delphi XE3 upd 2.
Thanks.
program Loader;
{$APPTYPE CONSOLE}
{$R *.res}
uses
MidasLib,
System.SysUtils,
Winapi.Windows,
Data.DB,
Datasnap.DBClient;
var
cds : TClientDataSet;
start, stop : Cardinal;
begin
cds := TClientDataSet.Create(nil);
try
start := GetTickCount;
cds.LoadFromFile('c:\temp\data.xml');
stop := GetTickCount;
Writeln(Format('Time elapsed: %dms', [stop-start]));
finally
cds.Free;
end;
end.