perf(http/file_server): read fileinfo in parallel#3363
Merged
kt3k merged 2 commits intodenoland:mainfrom May 6, 2023
Merged
Conversation
kt3k
reviewed
May 6, 2023
| return createCommonResponse(Status.OK, file.readable, { headers }); | ||
| } | ||
|
|
||
| // TODO(bartlomieju): simplify this after deno.stat and deno.readDir are fixed |
Member
There was a problem hiding this comment.
Note: This is an ancient comment by Kevin and this doesn't seem relevant anymore. https://github.com/denoland/deno_std/pull/15/files#diff-106086daad2313990285a9c61085eeb5995d479127db151e613f84ea709450c8R104
kt3k
reviewed
May 6, 2023
| name: string; | ||
| } | ||
|
|
||
| const encoder = new TextEncoder(); |
Member
There was a problem hiding this comment.
Note: Response object take care of encoding, and this is unnecessary now. Nice clean up.
Contributor
Author
|
Thank you for your review! 🙇♂️ There is a PR on deno_blog that does a similar optimization. If you don't mind, please take a look when you have time. denoland/deno_blog#116 |
mxdvl
pushed a commit
to mxdvl/deno_std
that referenced
this pull request
May 16, 2023
This was referenced Dec 10, 2023
This was referenced Dec 19, 2023
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.
part of #3361
Previously, fileInfo was read serially when generating directory listing pages. Change this to read in parallel.
After this PR, the display of the directory listing (page below) is tens of milliseconds faster.
benchmark code: