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

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

问题描述

我声明 MidasLib 是为了避免在某些客户端中由 Midas.dll 引起的 dll 地狱.

I´m declaring MidasLib to avoid dll hell caused by Midas.dll in some clients.

下面的代码运行时间约为 2350 毫秒.如果我删除使用中的 MidaLib 声明,它将在 45 毫秒内开始运行!!

The code below runs in about 2350ms. If I remove the MidaLib declaration in uses it starts to run in just 45ms!!

data.xml 文件是用 TClientDataSet.SaveToFile 方法保存的,有 5000 条记录,大小约为 600Kb.

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?

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

I can confirm the problem in Delphi XE2 upd 3 and in Delphi XE3 upd 2.

谢谢.

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:	empdata.xml');
    stop := GetTickCount;
    Writeln(Format('Time elapsed: %dms', [stop-start]));
  finally
    cds.Free;
  end;
end.

推荐答案

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

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

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

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