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

shinyFiles re-indexes folder contents slowing down performance. #140

Open
PhilipFaure opened this issue May 18, 2020 · 8 comments
Open

shinyFiles re-indexes folder contents slowing down performance. #140

PhilipFaure opened this issue May 18, 2020 · 8 comments

Comments

@PhilipFaure
Copy link

Hi,

We are using your shinyFiles package extensively within an app we are developing. We really like shinyFiles, but we have one issue for which we can not find a work around. Often, users will be working with large hard drives (e.g. 4 Tb drives) and some folders on it may easily contain well over 200,000 images. With such folders, if an user clicks on or tries to open one of these folders using shinyFiles it dramatically slows down. The app we are developing is run using a containerised instance.

My question is whether there is a way to stop shinyFiles from indexing all the files in the content viewer panel, or some other way to speed it up? Perhaps can the viewer be turned off somehow to speed up performance, would that work?

I’ve looked extensively on stackoverflow and other sites for anyone else reporting a similar issue, but with no success.

Thank you in advance for your time,

Best Wishes,
Philip

@vnijs
Copy link
Collaborator

vnijs commented May 19, 2020

I assume you are talking explicitly about the shinDirChoose? There is currently no way to turn off the preview. I agree that it might make sense to try and limit the size of the preview.

@pantheracorp
Copy link

@vnijs @PhilipFaure – we are having the same issue for shinyDirChoose. Is there any plan to allow users to limit these previews, @vnijs? That may really help! Thanks

@vnijs
Copy link
Collaborator

vnijs commented May 27, 2020

I could add a max_files argument to shinyDirChoose. If you set that to, e.g., 1000 you wouldn't only see the first 1000 entries from fs::dir_ls. Would that work for you?

@pantheracorp
Copy link

Hi @vnijs, that would work, assuming it'll speed up the process? Thank you!

@vnijs
Copy link
Collaborator

vnijs commented May 27, 2020

Try the below and let me know if you see any issues:

remotes::install_github("thomasp85/shinyFiles@max_files")

@pantheracorp
Copy link

The recent update unfortunately increases the computation time, it's taking even longer (~ 50% longer) to drill down into directories when max_files = 10, compared to the default. Just for clarity, when using shinyDirChoose, is the function indexing or caching the entire folder contents? Just trying to get an idea of why there is such a delay. Many thanks

@vnijs
Copy link
Collaborator

vnijs commented May 29, 2020

I see no reason why the changes in the commit linked below could increase computation time. I'm afraid you will have to dig into the fileGetter function to explore what might address you specific situation

680c1c2

@sneumann
Copy link

sneumann commented Nov 8, 2023

Hi, just weighing in here, indeed for e.g. NFS mounted home directories things are painfully slow.
I'll happily trade speed for eye-candy.
Yours, Steffen

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants