Jump to content

How to minimize time between FormCreate and FormReady


irigsoft

Recommended Posts

Hello.

I'm trying to optimize my uniGui project.

I found that between MainForm.Create and MainForm.OnReady the time is 20 seconds.

I MainForm has 50 elements (panels, buttons, group boxes, TuniDBGrids, label).

Now I use:
1. After logging in, I create all the components from an ini file

2. When I start creating a component, I set the form to SuspenLayouts

3. When Mainform is created, set Visible: = False and start creating the components.

4. Once all components are created set the form ResumeLayouts and Visible: = True;

When a form is first created (after starting the server), I get a time of 20 seconds between FormCreate and FormReady.

After closing the session and creating a new one, the time (between FormCreate and OnReady) is 3 seconds.

Can I optimize these 3 seconds in some way using javascript methods ?

If there is any method to optimize the first 20 seconds I would also ask for help.

Link to comment
Share on other sites

3 minutes ago, irigsoft said:

When a form is first created (after starting the server), I get a time of 20 seconds between FormCreate and FormReady.

After closing the session and creating a new one, the time (between FormCreate and OnReady) is 3 seconds.

If there is any method to optimize the first 20 seconds I would also ask for help.

Hello,

Are you using customFiles (js, css)?

 

Link to comment
Share on other sites

19 minutes ago, Sherzod said:

Hello,

Are you using customFiles (js, css)?

 

Hello, this is on mainForm.Script:

Ext.onReady(function() {
    document.body.onresize = function() {
        var clW = document.body.scrollWidth;
        var clH = document.body.scrollHeight;
        var values = clW + 'px ' + clH + 'px';
        document.body.style.backgroundSize = values;
    };

    window.location.hash = "main";
    window.location.hash = "again_main"; // again for chrome
    
});

I think the problem is in the javascript rendering of the form (and components), but I'm not good with javascript and I'm looking for help.

I'm not sure if SuspendLayout is enough

I can't apply this: first create all components with nil and then set a parent. (I read this from some topics)

Link to comment
Share on other sites

10 minutes ago, Sherzod said:

If you clear the cache and open the page, then again it takes 20 seconds?

Yes,

Always when I start my Standalone application, first session is so slow.

 

I have to say that: my MainForm is created very quickly, I have a button on it, after clicking on this button, I create the next form (I use this next form as the main form).

In simple words: I don't have an login form, my basic form is made as an login form.

All that situation is between Form Create and OnReady on this second form.

Link to comment
Share on other sites

@Sherzod,If we forget about charging time the first time.

Can you tell me what to look for to optimize the time between FormCreate and OnReady for each subsequent session.

If I have many components and all of them, I create them dynamically, which is the best way to optimize the rendering time of the form.

Link to comment
Share on other sites

Hello again.

I do a test case with some of the components, but the speed is different when loading the first session (less than 2 seconds).

In the real project I have many other components, all of them invisible (images, panel, group boxes, bitbtns, labels).

Do I have a way to move all these components to some hidden panel to speed up real project, or add some javascript in this components?

Link to comment
Share on other sites

I think the delay is actually, in unigui loading your user section, as you said the delay and only when you start the standalone server for the first time, in a production environment, your standalone server will be running all the time, the it's not clear when you need to update your system so I don't think this should be taken into account.

Link to comment
Share on other sites

9 hours ago, wilton_rad said:

I think the delay is actually, in unigui loading your user section, as you said the delay and only when you start the standalone server for the first time, in a production environment, your standalone server will be running all the time, the it's not clear when you need to update your system so I don't think this should be taken into account.

Thank You.

I am of the same opinion that the initial delay is permissible, but I hope for some help in optimizing the display of the components themselves in the form. Since the next charges take 3-4 seconds and I would like to optimize it at least in half

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.

×
×
  • Create New...