gpt4 book ai didi

performance - 程序在几台计算机上运行缓慢

转载 作者:行者123 更新时间:2023-12-03 15:02:51 25 4
gpt4 key购买 nike

我有一个在多台网络 PC 上运行的程序。当我编译最新版本时,它在网络上的 2 台 PC 上运行速度非常慢,但对于其他人来说运行良好。

当我安装了额外的 2GB RAM 时,我的旧开发 PC 上经常会发生这种情况。当我删除额外的 2GB 并重新编译时,它对每个人来说都可以正常工作。

现在,我在一台全新的机器上并且遇到了同样的问题。我尝试在重新启动后重建项目,但仍然遇到同样的问题。

对于所有其他 PC,程序加载时间约为 3-5 秒。在这 2 台电脑上,加载时间从 45 秒到 1.5 分钟不等...

其中一台 PC 是较旧的 Dell Dimension 8200,但另一台是较新的 OptiPlex,与网络上的其他几台 PC 相同,因此这才是真正令人困惑的原因。

目前,我必须恢复到旧版本,以便每个人都可以正确运行。

有人知道可以尝试什么吗?

提前致谢!!!

<小时/>

编辑:

好吧,昨天真是筋疲力尽,尝试了各种方法来解决这个问题。这是我尝试过的以及问题开始的地方:

使用新程序

返回到所有更新组件的旧版本,但仍然遇到相同的问题

使用旧程序

我决定回到绘图板,从旧版本的应用程序开始,一次一小部分地逐步添加新功能。

  1. 使用旧组件重新编译旧版本 - 程序运行良好
  2. 更新到新的 DevExpress 组件 - 程序运行良好
  3. 更新到新的 ESBPCS 组件 - 程序运行良好
  4. 更新至新的 DeepSoftware 组件 - 程序运行良好

好的,现在我们知道我更新的组件集没有任何内容......

  1. 已向 2 个图像列表中的每一个添加 1 个图像 - 程序运行正常
  2. 添加了新的数据库表 - 程序运行良好
  3. 添加了打开和关闭新表的代码 - 程序运行良好
  4. 向操作列表添加了新操作,并向新操作添加了菜单项和工具栏按钮(操作此时不执行任何操作)- 程序运行正常
  5. 向应用程序添加了一个新的空白表单,并添加了打开新表单的代码 - BAM!!!

因此,仅向应用程序添加一个表单就是导致问题的原因!我删除了打开表单的所有代码,注释掉了 use 子句,并从项目源中删除了 use 条目,一切都恢复正常!

有人对此有任何想法吗?

谢谢!

<小时/>

编辑2:

对于 @Warren P - 这是我的 .DPR 来源:

program Scheduler;

uses
ExceptionLog,
Forms,
SchedulerMainUnit in 'SchedulerMainUnit.pas' {FrmMain},
SchedulerDBInfoUnit in 'SchedulerDBInfoUnit.pas' {FrmDBInfo},
SchedulerHistoryUnit in 'SchedulerHistoryUnit.pas' {FrmHistory},
SchedulerOptionsUnit in 'SchedulerOptionsUnit.pas' {FrmOptions},
SchedulerExtVersionUnit in 'SchedulerExtVersionUnit.pas' {FrmExtVersion},
SchedulerSplashUnit in 'SchedulerSplashUnit.pas' {FrmSplash},
SchedulerInfoUnit in 'SchedulerInfoUnit.pas' {FrmInfo},
SchedulerShippedUnit in 'SchedulerShippedUnit.pas' {FrmShipped}; {<-- This is the new form with the issue}

{$R *.res}

begin
Application.Initialize;
Application.Title := 'SmartWool WIP Scheduling Assistant';
Application.CreateForm(TFrmMain, FrmMain);
Application.CreateForm(TFrmDBInfo, FrmDBInfo);
Application.CreateForm(TFrmHistory, FrmHistory);
Application.CreateForm(TFrmOptions, FrmOptions);
Application.CreateForm(TFrmExtVersion, FrmExtVersion);
Application.Run;
end.

这是主窗体的初始化部分,用于创建启动画面:

initialization

FrmSplash:=TFrmSplash.Create(Application);
FrmSplash.Show;
FrmSplash.Refresh;
<小时/>

编辑3:

有人吗???请问?

最佳答案

当尝试访问该计算机上不可用的资源(例如网络驱动器或 Internet 主机)时,程序可能正在等待超时。

尝试在启动程序时运行进程监视器并查找文件打开调用。过滤输出,使其仅显示您的进程。

http://technet.microsoft.com/en-us/sysinternals/bb896645

关于performance - 程序在几台计算机上运行缓慢,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/5565567/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com