-
Notifications
You must be signed in to change notification settings - Fork 6.3k
Watcher and initial load performance improvements #357
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
Merged
Conversation
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
@code-asher
code-asher
changed the title
(削除) Watcher-related performance changes (削除ここまで)
(追記) Watcher and initial load performance changes (追記ここまで)
Mar 27, 2019
@code-asher
code-asher
force-pushed
the
perf/watcher
branch
from
March 27, 2019 19:24
49b598a to
6bdd87d
Compare
callbackify seems to always adds an error as the first argument. Opted to just use the promise for this one.
@code-asher
code-asher
force-pushed
the
perf/watcher
branch
from
March 27, 2019 19:27
6bdd87d to
c5b2deb
Compare
@code-asher
code-asher
changed the title
(削除) Watcher and initial load performance changes (削除ここまで)
(追記) Watcher and initial load performance improvements (追記ここまで)
Mar 27, 2019
code-asher
added a commit
that referenced
this pull request
Jun 19, 2019
* Set low CPU priority on watcher Fixes #247. * Batch stat and readdir calls * Fix fs.exists callbackify seems to always adds an error as the first argument. Opted to just use the promise for this one. * Batch lstat * Add maximum time for flushing batches
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.
statcalls.readdircalls.lstatcalls.I benchmarked using
statacross 10k files, with the current batch settings it seems to result in around a 1.5-1.9 increase in speed when ran locally.I'm not sure what the optimal batch size and timeout are, but I played around with how responsive the terminal felt and went with something that seemed reasonable. During load the terminal is much more responsive, but we might be able to further improve.
Edit: It looks like the remaining lag on the terminal during load is due to either the client parsing all the messages sent back to it from all the batched calls or the server stringifying all those messages (probably some of both). I suppose the only way to make it better is to somehow make
JSON.parseandJSON.stringifyasynchronous and low-priority for messages that don't need to be immediately responsive (maybe spawn a process or worker for those messages).Edit 2: Moving all the parsing/stringifying to separate threads using processes/workers might be a good idea?