-
Notifications
You must be signed in to change notification settings - Fork 1
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
feat: Optimize startup timings by delaying heavy tasts #1266
Merged
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 tasks
Ldoppea
changed the title
Feat/delay nonimportant calls
feat: Optimize startup timings by delaying heavy tasts
Dec 19, 2024
zatteo
approved these changes
Dec 20, 2024
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Nice optimization!
Ldoppea
force-pushed
the
feat/delay_nonimportant_calls
branch
from
December 20, 2024 14:24
8968982
to
7b1a62f
Compare
Ldoppea
force-pushed
the
feat/delay_nonimportant_calls
branch
from
December 20, 2024 14:30
7b1a62f
to
9ca8720
Compare
Ldoppea
force-pushed
the
feat/delay_nonimportant_calls
branch
from
December 20, 2024 16:43
9ca8720
to
bace560
Compare
Ldoppea
force-pushed
the
feat/delay_nonimportant_calls
branch
from
December 20, 2024 17:32
bace560
to
eb60cf2
Compare
Ldoppea
force-pushed
the
feat/delay_nonimportant_calls
branch
from
December 20, 2024 19:37
eb60cf2
to
5ae845f
Compare
Ldoppea
force-pushed
the
feat/delay_nonimportant_calls
branch
from
December 20, 2024 19:55
5ae845f
to
1cba83b
Compare
Ldoppea
force-pushed
the
feat/delay_nonimportant_calls
branch
from
December 20, 2024 20:09
1cba83b
to
9173b36
Compare
Ldoppea
force-pushed
the
feat/delay_nonimportant_calls
branch
from
December 20, 2024 20:20
9173b36
to
67b3e0e
Compare
Ldoppea
force-pushed
the
feat/delay_nonimportant_calls
branch
from
January 9, 2025 10:51
67b3e0e
to
c94cce5
Compare
Ldoppea
force-pushed
the
feat/mmkv
branch
2 times, most recently
from
January 17, 2025 10:20
37dc032
to
241c126
Compare
In #1209 we added CozyPouchLink to CozyClient's instance By default CozyPouchLink starts replicating all its database directly after being initialized This is problematic as this happens during the App's startup and so it will unnecessary slow the startup process This is unnecessary because on startup, either the app is offline and so replication cannot be done, either the app is online and so it will use the cozy-stack. So replication can be delayed We want to defer the replication to a short delay after the startup (for now 30s)
Downloading important files on startup may slow down the startup process, so we want to delay it (for now 30s after the startup)
Call to `synchronize()` may slow down the startup process but is not necessary for the app to work It is here only to update the cozy-settings's OAuth clients list to display the last connexion to the app So we chose to delay this call a short delay after the startup (for now 10s) By doing so, we may fail calling the `synchronize()` method if the user closes the app less than 10s after opening it, but as this is used only for display purpose, we chose to consider this as not-critical
Icons caching may slow down the startup process but is not necessary for the app to work If not called in time, this would only impact cozy-apps opening animation that will use generic icons (if never called before) or potentially old icons (in the rare cases when we update a cozy-app icon) So we chose to delay this call a short delay after the startup (for now 30s)
Ldoppea
force-pushed
the
feat/delay_nonimportant_calls
branch
from
January 17, 2025 10:29
c94cce5
to
630aa42
Compare
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
This PR's goal is to improve startup timings by delaying heavy tasks after the startup is complete.
What have been delayed:
synchronize()
apiFor now those delay have been hardcoded, but in the future we may want to implement some "orchestrator" mechanism that would be responsible to call those tasks when the application is IDLE