Solved

Speed my table opening

Posted on 2002-04-16
8
159 Views
Last Modified: 2010-04-04
I use in application two tables and two radio buttons .
When I click first button I open ... two databases in tables and when click the second button ....replace these with anothers .

When click the second radio button I pop-up a menu,too :

  Table2.Close;
  Table1.Close;
  Table1.TableName:=Path+'Database\gratuit.dbf';
  Table1.IndexName:='Gratuit';
  Table2.TableName:=Path+'Database\gratuit.dbf';
  Table2.IndexName:='Gratuit';
  Table2.Open;
  Table1.Open;
  Menu.AutoPopup:=True;
  Menu.Popup(0,0);

When run for the first time my app I have a 4-5 seconds delay before pop-up the menu .
Close the program .

Every time when I start the app after that the pop-up is displayed instantly .

How can I remove this delay for the first running ?
0
Comment
Question by:ginsonic
8 Comments
 
LVL 1

Expert Comment

by:Alone
ID: 6945107
IMHO, you must write a small dummy application like Microsoft OSA (form MS Office) which will slow down end-user computer during startup and ;-) maybe entire session :-))
0
 
LVL 45

Expert Comment

by:aikimark
ID: 6945128
You might not be able to remove the delay.  It is most likely caused by DLL loading and BDE initialization.  Once that has been done, subsequent executions don't experience that overhead.

You might be able to mask the delay by invoking some similar process during application startup (with a 'splash' form).  Also, you might this initialize task happen when the user is inactive or reading form content.
0
 
LVL 1

Expert Comment

by:adeng
ID: 6945358
when you open the table, bde create temporary table on the memory (or harddrive ?), it always slow on the first time, but you can try to optimize in the BDE Administrator (in the control panel), go to the "Configuration" tab > System > INIT, try to modify all the property, like MTS SPOOLING.

Some time I use TQuery instead of TTable, I find it faster.

Regards
Adeng
0
Free Tool: ZipGrep

ZipGrep is a utility that can list and search zip (.war, .ear, .jar, etc) archives for text patterns, without the need to extract the archive's contents.

One of a set of tools we're offering as a way to say thank you for being a part of the community.

 
LVL 27

Expert Comment

by:kretzschmar
ID: 6945364
you can't

as aikimark commented,
its because the bde
must initialze itself and
this take a bit time

i usual use a splash-screen,
as aikimark suggested,
with a nice picture and a bit text
(like tip of the day)

meikl ;-)
0
 
LVL 9

Author Comment

by:ginsonic
ID: 6945593
But the BDE is already initialize because at OnCreate I already have opened anothers tables.

 Table1.TableName:=Path+'Database\compens.dbf';
 Table1.IndexName:='Gratuit';
 Table2.TableName:=Path+'Database\Compens.dbf';
 Table2.IndexName:='Gratuit';
 Table2.Open;
 Table1.Open;
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6945625
if it already initialized,
and you've already a delay,
then raise the memory-entries at the
bdeadmin-configuration-system-init

0
 
LVL 27

Accepted Solution

by:
kretzschmar earned 50 total points
ID: 6945632
from borland

Q:   How can I optimize BDE performance on table operations?

A:   Although there are a number of ways to improve BDE
     performance, some general things to try are as follows:
        1) Keep the number of maintained secondary indexes to a
           minimum; sometimes it is better to delete the index
           and recreate it than to perform a number of table
           operations with the indexes in place.
        2) If possible, increase the size of the swap buffer
           and the number of file handles that the BDE has
           available to it.  This will decrease the Engine's
           need to swap resources. Note: make certain to
           increase the file handles available to your
           application using SetHandleCount, as well as
           increasing the number of file handles available to
           the BDE in IDAPI.CFG.
        3) Open the table exclusively.
        4) Batch as many opperations as possible - do not read/
           write records one as a time. Use DbiBatchMove,
           DbiCopyTable, DbiReadBlock, and/or DbiWriteBlock.
        5) When using DbiWriteBlock, try to work in multiples
           of the physical block size, usually 2k or 4k.
        6) If you are opening and closing one or more tables
           repeatedly, consider calling DbiAcqPersistTableLock
           on a non-existent file after you initialize the
           BDE. This will create the .LCK file so that it will
           not have to be created each time a table is opened,
           created, etc.  (Note:  you'll also want to call
           DbiRelPersistTableLock before calling DbiExit).
        7) Used Cached Updates
                          Paradox Tables Only.
        8) Work with in-memory tables when possible (Note that
           in-memory tables cannot be the source table to
           DbiBatchMove).

meikl ;-)
0
 
LVL 27

Expert Comment

by:kretzschmar
ID: 6945639
appendix

if you've a single-user app,
open your tables with the exclusiv-property set to true

referenced to point 6 above

meikl ;-)
0

Featured Post

Free Tool: Path Explorer

An intuitive utility to help find the CSS path to UI elements on a webpage. These paths are used frequently in a variety of front-end development and QA automation tasks.

One of a set of tools we're offering 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

A lot of questions regard threads in Delphi.   One of the more specific questions is how to show progress of the thread.   Updating a progressbar from inside a thread is a mistake. A solution to this would be to send a synchronized message to the…
Hello everybody This Article will show you how to validate number with TEdit control, What's the TEdit control? TEdit is a standard Windows edit control on a form, it allows to user to write, read and copy/paste single line of text. Usua…
The Email Laundry PDF encryption service allows companies to send confidential encrypted  emails to anybody. The PDF document can also contain attachments that are embedded in the encrypted PDF. The password is randomly generated by The Email Laundr…
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…

808 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