Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Program runs slow on just a couple of computers

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?

like image 530
Orionizer Avatar asked Apr 06 '11 11:04

Orionizer


People also ask

Why does my computer slow down when I open several computer programs?

Every open tab and every open program takes up a certain amount of space on your Random Access Memory (RAM). Having too many of them running at the same time means you are reducing the memory and processing power available for your computer to allow seamless transition from program to program or tab to tab.

Why is my PC so slow even with good specs?

When your high-end computer is running slow, you should do a malware scan, declutter the computer's storage, and stop temporary files. Other causes include a possible bottlenecked CPU, corrupted hard drive, and a loaded browser cache (especially Internet Explorer or Google Chrome).


2 Answers

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

like image 138
Ville Krumlinde Avatar answered Nov 15 '22 12:11

Ville Krumlinde


Performance problems initially can seem very daunting at first.

I have been on many teams where people have tried to guess at a reason for performance problems. This sometimes works, but is far less effective than actually measuring the code.

When reproducible on a development machine, I would recommend a profiler.

There was a previous question that asked about Delphi Profiling tools which has several possible tools you could use.

When you can't reproduce the problem on your development machine, then it becomes a bit more difficult, but not impossible. Typically I have found that problems are related to an application dependency that is different, and not performing well. Understanding the external influences on your application can help pinpoint the problem.

Specifically common external problems in some of my applications.

  • Network
  • Database
  • Application Servers
  • Installation or Data File Location (i.e. Disk Performance)
  • Virus and Malware Scanners
  • Other application interring with yours such as a virus.

To monitor for items related to the network (i.e. Database, web services, etc...) I typically use Wireshark which allows me to see if resources are responding in expected times. My most common problem is poor performing DNS and can found using Wireshark.

You can use the AutoRuns program to determine everything that starts up when your computer does, it's useful in determine differences between machines.

But most of all I have logging that can be turned on in my applications and this allows me to isolate the problem to a specific area of code. This narrowing down to a specific section of code reduces the guessing, and allows you to focus on a few possible problems.

like image 20
Robert Love Avatar answered Nov 15 '22 12:11

Robert Love