Re: Speed issue...



Hi!

I stripped all the code from the procedure that takes most CPU.
Scrolloing the table is then fast, but if I add:

DataForm.MTable.DisableControls;
DataForm.MTable.EnableControls;

These two lines consequently take 2 seconds.
Same for this two lines:

DataForm.MTable.Edit;
DataForm.MTable.Post;

Any editing is slow as hell.

Thanks!
Atmapuri

"Brian Bushay TeamB" <BBushay@xxxxxxxxx> wrote in message
news:toq373tgku0j4m6pcrqmq2cfhmmme68c62@xxxxxxxxxx

About 30 fields, number and text. No blobs, no long strings.
It is constantly slow. I am also using CalcFields event and turning
that off speeds things up by 2x when scrolling the database. Instead
of 1 second it takes about 0.5 seconds to move to the next record.

Each scroll operation executes a new Locate call with 2 indexed fields on
a database with about 3000 records.

DataForm.Table.Locate('LoID;CoID', VarArrayOf([DataForm.LTable['ID'],
DataForm.CTable['ID']]),[]);

Thats where the 0.5 second comes from. All tables here are TAdoTable.

The CalcFields fills four Calculated fields with the sum of 3 other number
fields
from the same record. This is the other 0.5 seconds of the .Next call
cost.

Making an edit is as slow as I mentioned.

Since you are using TadoTable try turning the TableDirect property to
True.
This will have Access use an internal cursor instead of generating a
Select
statement. This is faster for Access. You can also try replacing your
Locates
with Seek if the fields you are locating on are indexed.
Also try disableControls on the table you are locating on and
Enablecontrols
after the locate if you have any controls connected to these tables.
DisableControls adds some speed when moving records even if there are no
controls attached.
If there are any detail tables connected to the table you are scrolling
you
might want to disable controls on them to especially if they are not
visible.


--
Brian Bushay (TeamB)
Bbushay@xxxxxxxxx


.



Relevant Pages

  • Re: OnPaint and blocky refresh
    ... I'm already using double-buffering on all controls. ... Here's how I'm testing it in OnPaint: ... Invalidate will queue the redraw for next time your app is idle. ... you're scrolling). ...
    (microsoft.public.dotnet.framework.drawing)
  • Re: Looking for ideas
    ... might be a set of implementation choices that resulting in a kludge implementation. ... I would make sure that I created one of these controls on the dialog, invisible, and use ... However, if the dialog does not have vertical scrolling, you might have to recompute the ... If it is a dialog-based app, just create the dialog with WS_HSCROLL. ...
    (microsoft.public.vc.mfc)
  • Re: Looking for ideas
    ... Joseph M. Newcomer wrote: ... might be a set of implementation choices that resulting in a kludge implementation. ... it as the prototype to create other controls. ... Right now now I'm thinking a child window with horiz scrolling to contain the 'event controls.' ...
    (microsoft.public.vc.mfc)
  • Re: Testing Original Script
    ... This is the Original Script that Richard posted a couple of years ago, ... controls in the Popup to control midi volume and scrolling. ...
    (microsoft.public.windows.inetexplorer.ie6_outlookexpress.stationery)
  • Re: Scrolling!
    ... I will try using the SetStyle method and see how I get on. ... you can perform the rendering yourself and not use Controls. ... BTW, I like the quote. ... the user is actually scrolling. ...
    (microsoft.public.dotnet.languages.csharp)