-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
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
Code Quality: Optimize the code logic for loading the file list #15831
Conversation
There's no need to perform reordering every time some files are loaded, because the interval between each reordering is 500ms, which is too short for users to see the sorted results before it's reordered again. This means that during the file loading process, the sorting results are useless to users, and it also causes a lot of extra CPU computational overhead, leading to lag in the file loading process. It's sufficient to perform a single sorting of all files only after the file list has finished loading completely. Signed-off-by: Tptogiar <[email protected]>
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.
Your opinion is reasonable. If we can allow not sorting until all files are loaded, this PR is worth merging.
I would say this should be merged for the performance improvements. My testing shows loading a 43 thousand items folder on preview 3.5.10 takes 170+ seconds and this 15 seconds. |
@Tptogiar Thank you! |
@Tptogiar this issue and your pull request showcase the benefit of open-source. By identifying and addressing the issue, you have not only enhanced your own experience but also contributed to the overall improvement of Files for the entire userbase! |
Hello @yaira2 , I would like to ask you some questions about this project: How do you usually speed up project compilation? On my virtual machine, every time I modify the code and recompile, it takes about 30-50 seconds. Here are the hardware configurations of my virtual machine. What configuration options in Visual Studio can be adjusted to speed up the compilation? QEMU Virtual CPU version 2.5+ |
It depends on the specs but 30 seconds is pretty decent. For UI changes you can often take advantage of hot reload to avoid recompiling for every change.
We have some basic testing for accessibility as well as some simple file operations. Docs are here https://github.com/files-community/Files/blob/main/.github/CONTRIBUTING.md#running-interaction-tests-optional. |
In case you weren't aware, we have a Discord server and you're welcome to join https://discord.gg/files. |
Resolved / Related Issues
There's no need to perform reordering every time some files are loaded, because the interval between each reordering is 500ms, which is too short for users to see the sorted results before it's reordered again. This means that during the file loading process, the sorting results are useless to users, and it also causes a lot of extra CPU computational overhead, leading to lag in the file loading process. It's sufficient to perform a single sorting of all files only after the file list has finished loading completely.
Steps used to test these changes
Stability is a top priority for Files and all changes are required to go through testing before being merged into the repo. Please include a list of steps that you used to test this PR.