Skip to content

Improve startup performance #3257

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

Merged
merged 2 commits into from
Jan 24, 2021

Conversation

AndyMDoyle
Copy link
Contributor

@AndyMDoyle AndyMDoyle commented Jan 24, 2021

This PR improves startup performance and gets the user to an interactive state quicker by making the following changes:

  • CloudDrivesManager and DrivesManager have been removed from SettingsViewModel to allow app settings to be loaded and made available to launch the app as early as possible.
  • CloudDrivesManager and DrivesManager are instantiated using an async singleton pattern with them being constructed as early as possible, while not delaying the launch of the UI should one of them require longer to complete.
  • Certain initial dependencies are created in parallel to shave off a little more startup time.
  • ICloudProviderDetector's are loading asynchronously in parallel so that CloudDrivesManager only takes as long as the slowest ICloudProviderDetector. This is mainly where OneDriveCloudProvider relies on FullTrust and can be delayed by FullTrust loading slowly. With this design, all other ICloudProviderDetector's can complete while waiting for the slowest one.

In future there would be further opportunities to speed up the initial load by adding cloud drives to the UI individually as they load so that fast ICloudProviderDetectors appear straight away, and slower ones will gracefully appear in the UI a little later. However for now I don't feel any of the ICloudProviderDetectors's are slow enough to require even more changes.

@AndyMDoyle AndyMDoyle requested a review from yaira2 January 24, 2021 15:21
@yaira2 yaira2 added the ready to merge Pull requests that are approved and ready to merge label Jan 24, 2021
@yaira2
Copy link
Member

yaira2 commented Jan 24, 2021

:shipit:

@yaira2 yaira2 merged commit 0e93777 into files-community:main Jan 24, 2021
gave92 added a commit to gave92/files-uwp that referenced this pull request Jan 24, 2021
gave92 added a commit to gave92/files-uwp that referenced this pull request Jan 25, 2021
gave92 added a commit to gave92/files-uwp that referenced this pull request Feb 6, 2021
gave92 added a commit to gave92/files-uwp that referenced this pull request Feb 6, 2021
@AndyMDoyle AndyMDoyle deleted the improve_startup_performance branch February 14, 2021 13:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
ready to merge Pull requests that are approved and ready to merge
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants