Fix #124276 batch markdown file requests#124545
Merged
mjbvz merged 10 commits intomicrosoft:mainfrom Aug 3, 2021
nrayburn-tech:fix-124276
Merged
Fix #124276 batch markdown file requests#124545mjbvz merged 10 commits intomicrosoft:mainfrom nrayburn-tech:fix-124276
mjbvz merged 10 commits intomicrosoft:mainfrom
nrayburn-tech:fix-124276
Conversation
mjbvz
requested changes
May 26, 2021
extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts
Outdated
Show resolved
Hide resolved
extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts
Outdated
Show resolved
Hide resolved
|
|
||
| this._watcher.onDidChange(async resource => { | ||
| const document = await this.getMarkdownDocument(resource); | ||
| if (document) { |
Collaborator
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
Contributor
Author
nrayburn-tech
left a comment
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
requested changes
Jul 1, 2021
extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts
Show resolved
Hide resolved
extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts
Outdated
Show resolved
Hide resolved
extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts
Outdated
Show resolved
Hide resolved
cleanup function call remove modulo use
Contributor
Author
|
@mjbvz should all be resolved now. |
mjbvz
reviewed
Jul 6, 2021
Collaborator
mjbvz
left a comment
There was a problem hiding this comment.
Very small change but otherwise looks good for merging
extensions/markdown-language-features/src/features/workspaceSymbolProvider.ts
Outdated
Show resolved
Hide resolved
Contributor
Author
|
@mjbvz updated with the change and merged upstream. |
Collaborator
|
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.