Jump to content

bad performance when opening big form


snow
 Share

Recommended Posts

greetings,

 

the issue is bad performance when opening one of the biggest forms in my program. While in VCL desktop version it takes a few seconds (like 3-4) for the form to open, in uniGUI it takes about 40 seconds. this is unacceptable.

I am aware that this form is quite huge, having around 1200 individual components (all of which were put on the form in the designer (.dfm)). creating this many components takes time, but 40 seconds is way too much. like 4-5 seconds would be acceptable.

 

as a test case, please see attached picture below. it's a newly created project, and the only thing it does is creating instances of TUniComboBox. I timed how long it takes for the form to open by using the FormCreate (you could use FormShow for this, doesnt matter much) and FormAfterShow events. you can interact with the form only after it is shown, so FormAfterShow makes sense to use. as you can see, in this instance it took 47 (usually between 40 and 45) seconds for the form to open. this is an enormous amount of time, considering nothing else is being done. the only thing the user can do is sit around and wait (and maybe fall alseep).

 

please let me know how i can get this tremendous amount of time down to an acceptable level, or significantly improve performance as soon as possible.

 

thank you,

snow

 

 

977970844_UniGUIPerformance.thumb.JPG.63b6abfb333415edf47aa10445c6fa20.JPG

Link to comment
Share on other sites

Although I will leave others for a more technical response, I can only say from my experience that Ajax driven WebBased programming does not lend itself to simple porting from VCL legacy projects, granted Delphi wrapped Sencha objects do make for easy and quick pro-typing. I would encourage you to build your application from the ground up based on this new programming model.  

  • Like 1
Link to comment
Share on other sites

3 hours ago, andyhill said:

Although I will leave others for a more technical response, I can only say from my experience that Ajax driven WebBased programming does not lend itself to simple porting from VCL legacy projects, granted Delphi wrapped Sencha objects do make for easy and quick pro-typing. I would encourage you to build your application from the ground up based on this new programming model.  

1200 UniComboBox?

So many controls,

But I think there will be some method to short the time.

Is there some method like oracle's batch sql  commit?

waiting  for the solution....

Link to comment
Share on other sites

15 hours ago, snow said:

greetings,

 

the issue is bad performance when opening one of the biggest forms in my program. While in VCL desktop version it takes a few seconds (like 3-4) for the form to open, in uniGUI it takes about 40 seconds. this is unacceptable.

I am aware that this form is quite huge, having around 1200 individual components (all of which were put on the form in the designer (.dfm)). creating this many components takes time, but 40 seconds is way too much. like 4-5 seconds would be acceptable.

 

as a test case, please see attached picture below. it's a newly created project, and the only thing it does is creating instances of TUniComboBox. I timed how long it takes for the form to open by using the FormCreate (you could use FormShow for this, doesnt matter much) and FormAfterShow events. you can interact with the form only after it is shown, so FormAfterShow makes sense to use. as you can see, in this instance it took 47 (usually between 40 and 45) seconds for the form to open. this is an enormous amount of time, considering nothing else is being done. the only thing the user can do is sit around and wait (and maybe fall alseep).

 

please let me know how i can get this tremendous amount of time down to an acceptable level, or significantly improve performance as soon as possible.

 

thank you,

snow

 

 

977970844_UniGUIPerformance.thumb.JPG.63b6abfb333415edf47aa10445c6fa20.JPG

Hello, If You  just replace creating combobox with sleep (3); , then You will get 0:00 as time but this is not True.

Simple calculation : 1200 * 3 = 3600 ms , but "s" = 0 ?

 

Link to comment
Share on other sites

Hello again.

I'm doing some kind of test and the performance problem is only with ComboBoxes.

If you use labels, buttons or panels, the speed is more than 10 times faster.

I don't know why creating combo boxes is so slow

Link to comment
Share on other sites

On 10/9/2021 at 8:43 AM, irigsoft said:

Hello, If You  just replace creating combobox with sleep (3); , then You will get 0:00 as time but this is not True.

Simple calculation : 1200 * 3 = 3600 ms , but "s" = 0 ?

 

 

as you probably figured out by now, the point of s is to measure the time it takes for the form to show up in the browser. while creating 1200 ComboBoxes takes like 3-4 seconds (or a lot less when you add "visible := False;" to the loop), it still takes 40 seconds for the form to show up in the browser.

if you replace creating ComboBoxes with sleep(3), then the form shows up way faster. because it doesnt have 1200 ComboBoxes on it.

 

 

On 10/9/2021 at 11:32 AM, irigsoft said:

@snow did You seen this: 

 

 

yes, i have seen it. i've looked at a lot of performance related threads, but the tips there do nothing for my specific problem.

 

 

On 10/10/2021 at 8:26 AM, irigsoft said:

Hello again.

I'm doing some kind of test and the performance problem is only with ComboBoxes.

If you use labels, buttons or panels, the speed is more than 10 times faster.

I don't know why creating combo boxes is so slow

 

i've done some more testing myself. turns out TUniDBComboBox and TUniCheckComboBox are way worse.

Link to comment
Share on other sites

if i put the ComboBoxes inside a panel and use UniApplication as panel.Owner, then i get the loading time down to about 13 seconds.

but then i cant set p.parent to self, because p.OwnerForm has to be self.OwnerForm. InsertComponent sets p.Owner to self, but creates a host of problems of its own.

 

 

grafik.png.6182d13224413971c66cb0d245cdb0e4.png

Link to comment
Share on other sites

the bottleneck seems to be TUniItemedFormControl.WebCreate in unit uniMultiItem. times are for 1200 ComboBoxes:

Creating FStore takes about 10 seconds.

JSConfig('proxy', takes about 6 seconds.

JSAddEvent( takes about 15 seconds.

 

since those methods are defined in units we have no access to, there doesnt seem to be a lot i can do. and even then it's JavaScript, which isn't my forte.

 

dear people of uniGUI, please fix this performance issue.

 

grafik.png.5ef5eda1c41c695ffb7e02f08f6749d8.png

Link to comment
Share on other sites

52 minutes ago, Sherzod said:

Hello,

Do you have 1200 combo boxes on your form? I think you should review the logic of your program.

Hello, for me:

1. I have dinamic creation of components after user login.

2. Browser need 3-4 seconds on mobile devices to show created form (Professional version UniGUI). I dont use many comboboxes (less then 10), but I use Button/Speedbuttons/Bitbtns/Labels/Images/DBGrids/Panels/GroupBoxes/ScrollBars, maybe 100 or 200 per Form.

3. I have dinamically created frames  and smallest time to show data is 2 seconds on mobile device (2GB Ram, CPU: 1.7 GHz)

Creations is on server side.

Link to comment
Share on other sites

hi snow

I don't know if this will help you but try it.

- I had to make a frame that have more components than that depend on the user selection I create from 500 up to 1800 unipanel that have labels and other controls ,

running this at one go take up to 50 sec sometimes,

I tested with uniTimer and created the panels in patches each time no more than 200 panel and now it takes 19 sec that is 60% faster.

- another note that surprised me and I cannot explain that documentation and other posts say to create(self) is faster but with testing create(uniParentPanel) saved me one sec.

- lastly try to redesign your frame, removing even one repeating label make deferent at these high numbers

regards

 

Link to comment
Share on other sites

still not understanding what the user will do in a form with 1200 combobox with no data listed. in your example, you haven't even included information in this combobox yet, that will bring more delay in the assembly of the screen

I would solve this in a form with several tabs (pagecontrol), and in each tab would create a limited amount of fields, when accessing the next tab the controls would be created, so I wouldn't need to create everything at once.

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

 Share

×
×
  • Create New...