perf: optimize cache listing for local, ssh and hdfs#2836
Merged
Conversation
- make all three lazy - simplify local one - use deque instead of list for hdfs
pared
reviewed
Nov 25, 2019
Comment on lines
+267
to
+269
| # If we simply return an iterator then with above closes instantly | ||
| for path in ssh.walk_files(self.path_info.path): | ||
| yield path |
Contributor
There was a problem hiding this comment.
Wouldn't that mean that connection will be open until the iterator is closed?
Considering that now it is used only in remote.all, which was supposed to create a generator in the first place this change is good.
I am just wondering if it will not become fragile if, in the future, we will start to wrap some logic around this method (for any reason). But also, I am worrying prematurely here. I just wanted to ask this and keep in mind for the future.
Contributor
Author
There was a problem hiding this comment.
Yes, this will hold the connection open. Not sure this will be an issue.
pared
approved these changes
Nov 25, 2019
Contributor
Author
|
@MrOutis may you take a look at this? |
ghost
reviewed
Nov 28, 2019
|
|
||
| executable = os.getenv("SHELL") if os.name != "nt" else None | ||
| p = Popen( | ||
| p = subprocess.Popen( |
ghost
approved these changes
Nov 28, 2019
Contributor
|
Thank you @Suor ! 🙏 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Uh oh!
There was an error while loading. Please reload this page.