MidasLib.dcu使应用程序更慢 [英] MidasLib.dcu makes the application slower

查看:407
本文介绍了MidasLib.dcu使应用程序更慢的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



下面的代码运行在2350ms左右。如果我删除了使用的MidaLib声明,它将在45ms内开始运行!!



data.xml文件与TClientDataSet.SaveToFile方法一起保存,具有5000条记录及其大小约为600Kb。



有谁知道如何解释这个奇怪的行为?



我可以在Delphi XE2 upd 3和Delphi XE3 upd 2中确认问题。



谢谢。 / p>

 程序加载器; 

{$ APPTYPE CONSOLE}

{$ R * .res}

使用
MidasLib,
System.SysUtils ,
Winapi.Windows,
Data.DB,
Datasnap.DBClient;

var
cds:TClientDataSet;
开始,停止:红衣主教;
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;
结束
结束。


解决方案

这是一个已知的错误/回归,见QC报告





此论坛线程




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.

解决方案

It is a known bug/regression, see the QC reports

and this forum thread

这篇关于MidasLib.dcu使应用程序更慢的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆