Fix #124276 batch markdown file requests#124545
Merged
Merged
Conversation
mjbvz
suggested changes
May 26, 2021
|
|
||
| this._watcher.onDidChange(async resource => { | ||
| const document = await this.getMarkdownDocument(resource); | ||
| if (document) { |
Contributor
There was a problem hiding this comment.
Can you please make these changes in a separate PR? I'd like to keep this one scoped to just batching the requests
nrayburn-tech
commented
May 27, 2021
nrayburn-tech
left a comment
Contributor
Author
There was a problem hiding this comment.
@mjbvz updated.
| return docs.filter(doc => !!doc) as SkinnyTextDocument[]; | ||
|
|
||
| // add 1 in case of any remaining files, | ||
| // ex (10 % 3) = 3, needs 1 more loop to complete |
Contributor
Author
There was a problem hiding this comment.
Is this comment necessary?
| const resourceBatch = resources.slice(i * maxConcurrent, (i + 1) * maxConcurrent); | ||
| (await Promise.all(resourceBatch.map(async doc => { | ||
| return await this.getMarkdownDocument(doc); | ||
| }))).filter((doc) => !!doc); |
Contributor
Author
There was a problem hiding this comment.
Should this be broken up for readability?
mjbvz
suggested changes
Jul 1, 2021
cleanup function call remove modulo use
Contributor
Author
|
@mjbvz should all be resolved now. |
mjbvz
reviewed
Jul 6, 2021
mjbvz
left a comment
Contributor
There was a problem hiding this comment.
Very small change but otherwise looks good for merging
Contributor
Author
|
@mjbvz updated with the change and merged upstream. |
Contributor
|
Thanks! This is schooled to go out with VS Code 1.60 at the end of this month |
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 subscribe to this conversation on GitHub.
Already have an account?
Sign in.
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.
| undefined. This doesn't seem like a valid return type for that function and allowed some ifs to be removed, and a filter on the batching requests function.I would expect using batches to reduce performance on workspaces that have a large number of
.mdfiles. I don't have a good way to test this for comparison though.This PR fixes #124276.