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 performance of watcher, operations and props loading #6028

Merged
merged 25 commits into from
Sep 6, 2021

Conversation

hez2010
Copy link
Member

@hez2010 hez2010 commented Sep 3, 2021

Details of Changes

  • Remove unnecessary semaphore
  • Added AsyncManualResetEvent to unblock threads
  • Insert a bunch of cancellation points for props loading to cancel eagerly before heavy I/O operations
  • Remove SQLite naming cache because it harms navigation speed and introduced inconsistency (displayName may change), but only brings little benefit, which doesn't worth
  • Parallelize copy, cut and remove preparation process

File creation is usually a combination of creation (creating a file handle) and modification (writing initial content), given that UpdateFileOrFolderAsync is slow, we introduced performance regression unexpectedly in #5992. This PR also aims to resolve the performance issue of UpdateFileOrFolderAsync:

  • Lowered priority of file update
  • Avoid checking sync status for folders don't support sync
  • Parallel update

Contributes to #4180

Validation
How did you test these changes?

  • Built and ran the app
  • Tested the changes for accessibility

Screenshots (optional)
Before:

before.mp4
before.mp4

After:

after.mp4
after.mp4

@zsh2401
Copy link

zsh2401 commented Sep 3, 2021

Wonderful Effect!

@hez2010 hez2010 mentioned this pull request Sep 3, 2021
2 tasks
@hez2010 hez2010 changed the title Improve performance of properties loading Improve performance of watcher and properties loading Sep 3, 2021
@yaira2 yaira2 requested a review from gave92 September 3, 2021 13:48
@hez2010
Copy link
Member Author

hez2010 commented Sep 5, 2021

@gave92 Improvements I planned to do have done. This PR is ready for review now.

@hez2010 hez2010 changed the title Improve performance of watcher and properties loading Improve performance of watcher, operations and props loading Sep 5, 2021
@yaira2 yaira2 requested a review from winston-de September 6, 2021 01:33
Copy link
Contributor

@winston-de winston-de left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

lgtm

@winston-de
Copy link
Contributor

Probably also closes #5822

@yaira2
Copy link
Member

yaira2 commented Sep 6, 2021

Probably also closes #5822

It doesn't seem to load thumbnails much faster.

@yaira2 yaira2 added ready to merge Pull requests that are approved and ready to merge and removed needs - code review labels Sep 6, 2021
@yaira2 yaira2 merged commit 8c2d0b1 into files-community:main Sep 6, 2021
@yaira2
Copy link
Member

yaira2 commented Sep 6, 2021

@hez2010 great work!

@hez2010
Copy link
Member Author

hez2010 commented Sep 6, 2021

@yaichenbaum This PR somehow makes icon loading higher priority than extended props loading, so it does contribute to #5822

@hez2010 hez2010 deleted the props-imp branch September 6, 2021 15:53
@Josh65-2201

This comment has been minimized.

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.

5 participants