Re: 100% CPU usage to do nothing.



The code you posted could spike the CPU to 100% if the result set is large
enough.

You could limit the result set (return fewer records) and/or try wrapping
the while loop in a DisableControls/EnableControls
TblSql.DisableControls():
try
{your while loop}
finally
TblSql.EnableControls();
end;

Good luck,
krf

"Donald S. Bossen" <sbossen@xxxxxxxxxxxxxxx> wrote in message
news:4767f2a1@xxxxxxxxxxxxxxxxxxxxxxxxx
Using Delphi6 and ADOData Set and connection componetes.
In this application I am selecting a large amount of data from a Microsoft
SQL2005 and noted it running slow the CPU was at 100% and the process was
slowing with time. So I commented all out as to have this
TblSql.First
while not TblSql.Eof do
begin
TblSql.next;
end;
and it takes the same length of time with 100% usage. Any Ideas on what is
wrong and how to fix.
Thanks
Donald S. Bossen
J&B Importers Inc.



.



Relevant Pages

  • Re: Cost of calling a standard library function
    ... It accesses/reads memory using esi 4 ... > safly move it within the cache, without having to go via ebx. ... try it the same thing on a different earlier CPU, ... should check it out...for "tight inner loop" stuff, ...
    (alt.lang.asm)
  • Re: Polling, Interrupts, DMA, Synchronous, Asynchronous I/O Definitions
    ... the terminology is less useful than it might be. ... though a "message loop" could arguably be claimed to be ... considering in a particular iteration but what is true for _ALL_ ... watching the "polling" version eating up every single CPU cycle ...
    (alt.lang.asm)
  • Re: getting a threads state and CPU utilization
    ... of CPU time currently being used)? ... How could you tell an infinite loop from a polling loop ... responding to continuous messages from many client apps, ... though the customer *claims* that the client app is disconnecting (I suspect ...
    (microsoft.public.win32.programmer.kernel)
  • Re: Detect the loop for batch job
    ... We are looking for a tool to detect the loop for batch application, ... step is to impose and enforce standards requiring reasonable CPU TIME ...
    (bit.listserv.ibm-main)
  • Re: sched_yield() problems...
    ... register in the CPU core. ... This is a 64 bit register that count the clock ... loop, I get reaction time of less than 10 us. ... In fact, I don't know why your gettimeofday don't work, so don't blame ...
    (alt.os.linux.redhat)