irigsoft Posted November 24, 2021 Share Posted November 24, 2021 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. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 24, 2021 Share Posted November 24, 2021 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)? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted November 24, 2021 Author Share Posted November 24, 2021 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) Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 24, 2021 Share Posted November 24, 2021 I mean, files that can also take a while to load the first time, before caching. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted November 24, 2021 Author Share Posted November 24, 2021 1 minute ago, Sherzod said: I mean, files that can also take a while to load the first time, before caching. No, I dont have external files Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 24, 2021 Share Posted November 24, 2021 If you clear the cache and open the page, then again it takes 20 seconds? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted November 24, 2021 Author Share Posted November 24, 2021 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. Quote Link to comment Share on other sites More sharing options...
Sherzod Posted November 24, 2021 Share Posted November 24, 2021 Could you make a test application for analysis? Quote Link to comment Share on other sites More sharing options...
irigsoft Posted November 24, 2021 Author Share Posted November 24, 2021 1 hour ago, Sherzod said: Could you make a test application for analysis? I am sorry, is not possible. The code is complex and test case is not possible to be created. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted November 24, 2021 Author Share Posted November 24, 2021 @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. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted November 25, 2021 Author Share Posted November 25, 2021 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? Quote Link to comment Share on other sites More sharing options...
Wilton Ergon Posted November 26, 2021 Share Posted November 26, 2021 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. Quote Link to comment Share on other sites More sharing options...
irigsoft Posted November 27, 2021 Author Share Posted November 27, 2021 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 Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.