Delphi – Program runs slow on just a couple of computers

delphiperformance

I have a program that I run on multiple network PCs. When I compiled the most recent version, it runs extremely slowly on 2 PCs on the network, but runs fine for everyone else.

This used to happen with my old dev PC when I had an additional 2gb RAM installed. When I would remove the additional 2gb and recompile, it would then work fine for everyone.

Now, I am on a completely new machine and am having the same issue. I've tried to rebuild the project after rebooting, but still have the same issue.

For all other PCs, the program loads in about 3-5 seconds. On these 2 PCs, it takes anywhere from 45 seconds to 1.5 mins to load…

One of the PCs is an older Dell Dimension 8200, but the other is a newer OptiPlex that is identical to several other PCs on the network, so this is what is really making it so confusing.

For now, I've had to revert to the old version so it will run correctly for everyone.

Does anyone have any idea of anything to try?

Thanks in advance!!!


Edit:

Ok, it was an exhausting day yesterday trying various things to solve this issue. Here is what I tried and where the problem begins:

Using the new program

Went back to old versions of all updated components, but still had the same issue

Using the old program

I decided to go back to the drawing board and start from the old version of the application and incrementally add the new features a small piece at a time.

  1. Recompiled the old version using the old components – program works fine
  2. Updated to new DevExpress components – program works fine
  3. Updated to new ESBPCS components – program works fine
  4. Updated to new DeepSoftware components – program works fine

Ok, so now we know there is nothing with the component sets I've updated…

  1. Added 1 image to each of 2 image lists – program works fine
  2. Added new database table – program works fine
  3. Added code to open and close the new table – program works fine
  4. Added new action to action list and added a menu item and toolbar button to new action (action does nothing at this point) – program works fine
  5. Added a new BLANK form to the application and added code to open the new form – BAM!!!

So, adding just one form to the application is what's causing the issue! I removed all the code for the opening of the form, commented out the uses clauses and removed the uses entry from the project source and everything is back to normal!

Anybody have any idea about this?

Thanks!


Edit 2:

For @Warren P – here is my .DPR source:

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.

And here is the intialization section of the main form to create the splash:

initialization

FrmSplash:=TFrmSplash.Create(Application);
FrmSplash.Show;
FrmSplash.Refresh;

Edit 3:

Anybody??? Please?

Best Solution

It could be that the program is waiting for timeouts when trying to access resources that are not available on that machine such as network drives or Internet hosts.

Try running Process Monitor when starting up your program and look for file open calls. Filter the output so it only shows your process.

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