Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

improve loading speed of the applications #870

Open
12rambau opened this issue Aug 31, 2023 · 4 comments
Open

improve loading speed of the applications #870

12rambau opened this issue Aug 31, 2023 · 4 comments
Labels
enhancement New feature or request frontend relative to the widgets display needs discussion needs discussion refactoring code enhancement

Comments

@12rambau
Copy link
Member

it seems multiple limitation are currently making application super slow to load. I thin a benchmark with tuna (#455) remains necessary, publishing the lib as an extension (#724) as well but these are complex modification that requires lots of efforts.

On the other hand looking at the latest development made by @dfguerrerom in sepal-contrib, I was thinking maybe we could fully integrate the lazy loading of the widget in the lib design.

  • for a panel app, only load the shown widget at start and lazy load the others upon click on the draweritems
  • for map application don't load any of the Views in the MapButton and only load the content upon first click

I'm not sure it would be that complicated, what do you think ?

@12rambau 12rambau added enhancement New feature or request refactoring code enhancement frontend relative to the widgets display needs discussion needs discussion labels Aug 31, 2023
@dfguerrerom
Copy link
Collaborator

dfguerrerom commented Aug 31, 2023

Thanks for bringing this topic in. Two things to say on this one:

  • There are some modules that can simple work without the lazy import, so if we really want to go through this implementation, we can do it with some optional arguments? I would like to have a clear idea on how this will work, I will be thinking on that and come up later with more thoughts...

  • For other apps as gwb, where all the steps are fully independent I think we can use a landing_page, as I just did on sepal-contrib/gwb@c9da838 (sorry for the boilerplate code but I hadn't time) and sepal-contrib/gwb@0c4c750, that's pretty much your second point.

  • I found a workaround (hack) to finally fix change the message for module loading  sepal#102 (comment), you can see the implementation on https://github.com/sepal-contrib/gwb/blob/master/ui.ipynb in the last two cells, when the apps are taking too long to load, users will have a message, I think we can use that message at the end by default...

@12rambau
Copy link
Member Author

12rambau commented Aug 31, 2023

I found a workaround (hack) to finally fix change the message for module loading openforis/sepal#102 (comment), you can see the implementation on https://github.com/sepal-contrib/gwb/blob/master/ui.ipynb in the last two cells, when the apps are taking too long to load, users will have a message, I think we can use that message at the end by default...

Finaly some clever idea on this one. I'm sad that it is as simple as adding a .md cell.....
But you are also removing the loading from voila right ?

@dfguerrerom
Copy link
Collaborator

I'm not removing the loading from voila, we;ll have "voila loading" when the imports and python packages are building the app, then we'll have the html message with an id="loading_message" until the js creates the ui, once the UI is fully loaded, there's a simple html style that will hide that element...
Yes, it's too sad have missed it for so long time :/

@dfguerrerom
Copy link
Collaborator

dfguerrerom commented Aug 31, 2023

Now that I've worked with that GWB module that uses sepal_ui==2.4.0 I think we have done something that makes the package to take too long to load... we'll have to further investigate that.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request frontend relative to the widgets display needs discussion needs discussion refactoring code enhancement
Projects
Status: To do
Development

No branches or pull requests

2 participants