No. Do not use LockWindowUpdate - is likely to fail. Was not designed
for this purpose.

We do however use (doubles the speed of form creation).

 

SendMessage( AForm.Handle, WM_SETREDRAW, 0, 0);              //Disable
redrawing of the main window stuff until the new screen has been created

Try

..

finally

            SendMessage( AForm.Handle, WM_SETREDRAW, 1, 0);  //Turn
drawing on again.

            InvalidateRect( 0, nil, True );                  //Cause all
windows to be redrawn!

End

 

- it does however introduce redrawing issues, in that while a form is
being created you get bleed through from other underlying application
windows if the user moves the mouse a lot - mind you it prob depends on
which windows you turn redraw off.

 

You can of course create forms/panels/controls in the background/not
visible and then just compose them and make them visible when required.

There are other things you can do to speed up Delphi in significant ways
- e.g. changes classes.component implementation of InsertComponent,
notifications etc. There are a few n squared algorithms hiding in the
TComponent class, which become significant when adding/removing lots of
components (the order can/does make a difference).

E.g. If you use a sorted TList instead and a binary search etc.

 

Of course it is best to run a performance profiler on the situation to
find the real causes.

 

Myles.

 

                

 

From: [EMAIL PROTECTED] [mailto:[EMAIL PROTECTED]
On Behalf Of Edwin Das
Sent: Thursday, 18 September 2008 11:15 a.m.
To: '[email protected]'
Subject: [DUG] performance of Bulk runtime Component creation

 

Hi All

 

I was wondering what the most efficient way is of creating many runtime
controls of various classes in Delphi.

 

So for each component you need to 

  Create it and set some properties. 

 

Is there a trick you can apply this to process that would speed it up?

I am thinking along the lines of maybe using lockwindowsupdate on either
all controls or the root container control.

I am wondering what else can be done to speed up this process.

Kind regards,

Edwin Das
MYOB Enterprise Division

 



Attention:
This communication is confidential and may be legally privileged.  If you are 
not the intended recipient, please do not use, disclose, copy or distribute it, 
other than to return it to us with your confirmation that it has been deleted 
from your system.
_______________________________________________
NZ Borland Developers Group - Delphi mailing list
Post: [email protected]
Admin: http://delphi.org.nz/mailman/listinfo/delphi
Unsubscribe: send an email to [EMAIL PROTECTED] with Subject: unsubscribe

Reply via email to