Recent

Author Topic: KOL-CE, speed of New...  (Read 6005 times)

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 168
    • http://www.jvdw.nl
KOL-CE, speed of New...
« on: May 14, 2008, 04:30:12 pm »
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: [Select]

 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;


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

  • Full Member
  • ***
  • Posts: 152
RE: KOL-CE, speed of New...
« Reply #1 on: May 14, 2008, 04:58:56 pm »
Can you create new test project which can reproduce this issue?

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 168
    • http://www.jvdw.nl
Re: RE: KOL-CE, speed of New...
« Reply #2 on: May 14, 2008, 05:18:22 pm »
Quote from: "yury_sidorov"
Can you create new test project which can reproduce this issue?


I'll try and get back...

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 168
    • http://www.jvdw.nl
Re: RE: KOL-CE, speed of New...
« Reply #3 on: May 15, 2008, 10:09:55 am »
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

  • Full Member
  • ***
  • Posts: 152
RE: Re: RE: KOL-CE, speed of New...
« Reply #4 on: May 16, 2008, 01:00:08 pm »
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...

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 168
    • http://www.jvdw.nl
RE: Re: RE: KOL-CE, speed of New...
« Reply #5 on: May 16, 2008, 01:14:29 pm »
ok, thanks, I'll check the SVN!

JohnvdWaeter

  • Full Member
  • ***
  • Posts: 168
    • http://www.jvdw.nl
RE: Re: RE: KOL-CE, speed of New...
« Reply #6 on: May 23, 2008, 12:25:13 pm »
Yury,

If I have a TKolPanel that is set to align=caClient at designtime, it should not be necessary to add lines like:

  Panel1.setAlign(caNone);
  Panel1.SetAlign(caClient);

To make it realign when its parent is resized?

Also, and perhaps the same issue: when the PDA is switched from Portrait to Landscape, the TKolForm's OnResize is triggered. Thats ok. But on Panels on the mainform with their align=caclient, do not get triggered. Their OnResize event is not fired.

Could it be there are more issues when resizing or realigning controls?

tia!
John

yuriy_sydorov

  • Full Member
  • ***
  • Posts: 152
RE: Re: RE: KOL-CE, speed of New...
« Reply #7 on: May 30, 2008, 10:58:56 pm »
This bug was introduced in rev. 270. It is fixed now.