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

Lots of unnecessary API calls when the list of available drives is large #5

Open
ali-tny opened this issue Aug 8, 2022 · 0 comments

Comments

@ali-tny
Copy link
Contributor

ali-tny commented Aug 8, 2022

At the moment, we always iterate through all the available drives calling the expensive _get_drive_root operation. The list drive object is actually a generator, but we turn it to a dictionary anyway which executes the entire generator.

there's caches to the method calls in question, but it doesn't really help because the standard API for using tentaclio is via tio.open, which creates a new client each time anyway, meaning the cache is useless

We should:

  • only iterate through drives until we find the right one
  • only call the expensive _get_drive_root method on that specific drive

needs a little bit of refactoring to do this cleanly

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

1 participant