Speed-up initial root directory load time
- Dominant language
- Kotlin
- Stars
- 5.6k
- Forks
- 2k
- Avg merge
- 2d 18h
- Merged PRs (30d)
- 92
Description
### How to use GitHub
* Please use the 👍 [reaction](https://blog.github.com/2016-03-10-add-reactions-to-pull-requests-issues-and-comments/) to show that you are interested into the same feature.
* Please don't comment if you have no relevant information to add. It's just extra noise for everyone subscribed to this issue.
* Subscribe to receive notifications on status change and new comments.
If the server instance is slow and the root folder is very large, the initial load time can be high.
I also noticed that the `listDirectory` function for the same directory gets called multiple times during the first app launch and twice while navigating.
```
OCFileListFragment.onActivityCreated
FDA.updateListOfFilesFragment
FDA.updateFileList
FDA.updateFileList
```
When I make `listDirectory` run only once, there is a small performance improvement, but the overall experience does not change significantly. Also, some caller functions come from important logic such as `SYNC_FOLDER` and` FDA.onResume`. These calls may be unnecessary at first launch, but they are required when the app moves to the background and foreground or after remote operations, as the list needs to be updated.
**Suggestion**
We should load the directory chunk by chunk instead of loading it fully, similar to how we handle the local file list adapter.
@tobiasKaminsky
Contributor guide
Assessment
This issue has not been assessed yet.