Solved

Why is my app running slowly?

Posted on 2002-05-01
13
137 Views
Last Modified: 2010-04-04
I built a custom database using DBASE V tables in Delphi.

When running on my computer, I search through 14000 plus records in a matter of around 3 seconds.

When on my customer's PC (which is 50mhz faster than mine), It takes around 30 to 40 seconds to search for the same records.

Both Laptops have 256 megabytes of RAM.

Any Ideas?????
0
Comment
Question by:accurates
13 Comments
 
LVL 14

Expert Comment

by:DragonSlayer
ID: 6984931
umm... did you index the tables?
0
 

Expert Comment

by:lottol
ID: 6985111
Seems it's problem with BDE configuration
0
 

Author Comment

by:accurates
ID: 6985124
The BDE Configuration is the same on both computers.

The tables all have multiple indexes.
0
Announcing the Most Valuable Experts of 2016

MVEs are more concerned with the satisfaction of those they help than with the considerable points they can earn. They are the types of people you feel privileged to call colleagues. Join us in honoring this amazing group of Experts.

 
LVL 44

Expert Comment

by:CrazyOne
ID: 6985286
What OS is on the customer's machine? If the OS is Win9x or ME then it could be an issue of System Resources, which is to say they may have too many programs running at the same time causing the System Resources to run quite low. In the case of System Resources the amount of RAM won't matter. Even if the System Resource percentage is not the problem the customer could still have a lot memory hungry programs running and the swap file is being used which would dramatically slow down things. Have them close down most of the programs they are running and see if this helps speed up things for you program.

Is the CPU on the customer's mahcine a Celeron?

Basically look for what is different from your machine and the customer's mahine. This might tell what the problem is.


The Crazy One
0
 

Author Comment

by:accurates
ID: 6985295
The processor is a Pentium III same as mine (700mhz & 750mhz)

The operating systems are both Windows XP Pro.
0
 
LVL 9

Expert Comment

by:ITugay
ID: 6985490
Hi accurates,

try to run different task instead of your application, may be it will be slow again. I mean that problem may be not in your app but in computers configuration. Something like realtime antivirus or something else.

-----
Igor
0
 
LVL 2

Expert Comment

by:freshman3k
ID: 6989265
Hello,

Make sure you use FindKey instead of Locate(if your using this search) . FindKey will utilize the indexes for faster search , while Locate will not.

Delphi Help has code snippets on how to use FindKey.

0
 
LVL 2

Accepted Solution

by:
mikepj earned 100 total points
ID: 7002850
The problem is that new laptops running W2K, XP, and I think ME judge how much work the computer is doing and scale down CPU speed.

I discovered this accidently with some hardware I have trouble communicating with.  I haven't found out what it is yet because I don't have a laptop of this kind which I can play with.

Part of the trouble seems to be Intel SpeedStep technology.  On one machine disabling Intel SpeedStep fixed it but this was not helpful on any of the other machines.

I've seen CPU speed on 800 MHz machines reported as low as 10 MHz by the routine below.  I have used this routine for years and it read perfectly until I discoveered this problem.

I think you'll find that this is the case.  I haven't found a way to fix it yet.  Please advise if you find a solution!

Thanks,
MP

program CPUSpeed;

uses
  Windows, SysUtils;

{$R *.RES}

function CPUSpd: String;
const
  DelayTime = 500; // measure time in ms
var
  TimerHi, TimerLo: DWORD;
  PriorityClass, Priority: Integer;
begin
     PriorityClass :=GetPriorityClass(GetCurrentProcess);
     Priority := GetThreadPriority(GetCurrentThread);
     SetPriorityClass(GetCurrentProcess,REALTIME_PRIORITY_CLASS);
     SetThreadPriority(GetCurrentThread,THREAD_PRIORITY_TIME_CRITICAL);

     Sleep(10);

     asm
        dw 310Fh // rdtsc
        mov TimerLo, eax
        mov TimerHi, edx
     end;

     Sleep(DelayTime);

     asm
        dw 310Fh // rdtsc
        sub eax, TimerLo
        sbb edx, TimerHi
        mov TimerLo, eax
        mov TimerHi, edx
     end;

     SetThreadPriority(GetCurrentThread, Priority);
     SetPriorityClass(GetCurrentProcess, PriorityClass);


     Result := IntToStr(Round(TimerLo / (1000.0 * DelayTime)));
end;

var
  S:String;
begin
  S:='CPU speed is '+CPUSpd+' MHz';
  MessageBox(0,PChar(S),'CPU Speed Check',MB_IconInformation+MB_OK);
    end;
end.
0
 

Author Comment

by:accurates
ID: 7007059
Thanks Mike, I belive you helped me solve it.
0
 
LVL 2

Expert Comment

by:mikepj
ID: 7007072
What was the answer?  I have remotely diagnosed this problem and have never had the luxery of personally having such a laptop at hand.

Thanks!
MP
0
 
LVL 2

Expert Comment

by:mikepj
ID: 7007124
What I mean to say is that I have an outstanding problem with my product which I have not been able to solve because I can't personally interact with any of the problem machines since they are spread around the world...

Knowing exactly how you got around it would help me very much because then I can e-mail some instructions to these various people for them to try.  Or maybe there is a change I can make in my app to turn the feature off while my app is busy.

Thanks!
MP
0
 

Author Comment

by:accurates
ID: 7007142
Hi Mike,

I disabled the Intel SpeedStep on the laptop and it sped up to what mine was searching at.

It is something to do with the Speed Step applet that was running on the machine, when I disabled it, the program ran like I thought it should.

Thanks again!
0
 
LVL 2

Expert Comment

by:mikepj
ID: 7007207
Thanks for the info!

MP
0

Featured Post

Free Tool: IP Lookup

Get more info about an IP address or domain name, such as organization, abuse contacts and geolocation.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
FMX enumerated colours 2 115
Can Viruses spread while transferring files via FTP protocol to unshared NAS drives ? 6 101
Working with hours 3 65
MS Access from Delphi 31 60
Objective: - This article will help user in how to convert their numeric value become words. How to use 1. You can copy this code in your Unit as function 2. than you can perform your function by type this code The Code   (CODE) The Im…
In my programming career I have only very rarely run into situations where operator overloading would be of any use in my work.  Normally those situations involved math with either overly large numbers (hundreds of thousands of digits or accuracy re…
Two types of users will appreciate AOMEI Backupper Pro: 1 - Those with PCIe drives (and haven't found cloning software that works on them). 2 - Those who want a fast clone of their boot drive (no re-boots needed) and it can clone your drive wh…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…

860 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question