openforis / sepal_ui

wrapper for ipyvuetify widgets to unify the display of voila dashboards in the SEPAL plateform
https://map-app.up.railway.app
MIT License
13 stars 4 forks source link

feat: draft async get assets #934

Closed dfguerrerom closed 2 months ago

dfguerrerom commented 2 months ago

from the current recursive function implementation the time to load 100 assets stored in multiple folders, the time was:

####################### Recursive ####################### Execution time: 13.889884233474731 seconds

By using the suggested implementation we could improve the result by 80%.

####################### Async Concurrent 2 ####################### Execution time: 2.823052406311035 seconds

codecov-commenter commented 2 months ago

:warning: Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

Attention: Patch coverage is 90.24390% with 4 lines in your changes missing coverage. Please review.

Project coverage is 96.50%. Comparing base (8a347a5) to head (4ce5069).

Files Patch % Lines
sepal_ui/scripts/gee.py 90.24% 4 Missing :warning:

:exclamation: Your organization needs to install the Codecov GitHub app to enable full functionality.

Additional details and impacted files ```diff @@ Coverage Diff @@ ## main #934 +/- ## ========================================== - Coverage 96.64% 96.50% -0.15% ========================================== Files 39 39 Lines 3964 4003 +39 ========================================== + Hits 3831 3863 +32 - Misses 133 140 +7 ```

:umbrella: View full report in Codecov by Sentry.
:loudspeaker: Have feedback on the report? Share it here.

dfguerrerom commented 2 months ago

It works but I don't want to dispatch threads to process the requests, I would like to create a fully asyncio call...

dfguerrerom commented 2 months ago

Adding max_concurrent_tasks parameter with a semaphore I think will be enough to be sure this feature won't cause any issue. I will merge this PR and later I will open a new one once https://github.com/dfguerrerom/ee-client/issues/3 integrates this changes.