Forum > KOL

KOL-CE, speed of New...

(1/2) > >>

JohnvdWaeter:
Hi,

I create vertical scrollable form layouts at runtime, depending on the user needs of that moment. The formlayouts contain kollabels, koleditboxes, kolcomboboxes, kolmemo's, kolbuttons, kolpaintboxes.

Most forms contain about 30-120 PControls, all aligned caTop.


--- Code: ---
 for n:=1 to NumberOfQuestions do  // 15 to 60 questions
  begin
   ALabel:=NewWordwraplabel(MyPanel,QuestionText[n]);
   ALabel^.align := caTop;

   AEditbox:=NewEditbox(MyPanel,[]);
   AEditbox^. align := caTop;
 {
  or
  APaintbox:= New...
  or
   ADateTime:=New...
  etc etc
  }

  end;

--- End code ---


I notice that if compiled for Win32/i386, the form is created allmost instantly. If compiled for WinCE/arm, the building of the form could take up to 20 seconds.

I also noticed that if I switch on the hourglass cursor at the beginning, and switch it off at the end, the hourglass is allready switched off and it still takes many seconds before the form really appears... Is this due to wince performing things in the background?

Is there a way to speed up this creation of forms?

(I did search the sources, really...)

tia
John

yuriy_sydorov:
Can you create new test project which can reproduce this issue?

JohnvdWaeter:

--- Quote from: "yury_sidorov" ---Can you create new test project which can reproduce this issue?
--- End quote ---


I'll try and get back...

JohnvdWaeter:
Ok, I have done some tests.
The differences are less because the demo in the zip is less complicated, but still significant.

Measured times:

Win32 version:
On PC XP 2.3 GHz : 31 ms
On PC Vista 4.0 GHz: 100 ms (o well, vista...)
On Laptop XP 2G: 64 ms
On old PC PII 233 MHz: 150 ms

WinCE version:
On Emulator (On PC XP 2.3 G): 3200 ms
On HTC 3470 handheld: 1400 ms

Please see the zip http://www.jvdw.nl/speedtest.zip with some inline comments in Unit1.

tia!
John

yuriy_sydorov:
I slightly improved speed of your example in the latest commits.

But the main speed impact in your example caused by Align.
I will add methods to disable/enable alignment of child controls later. Then it will be possible to disable align before creating new controls and enable it again at the end...

Navigation

[0] Message Index

[#] Next page

Go to full version