This repository was archived by the owner on Feb 26, 2024. It is now read-only.
patch fs methods as macrotask, add test cases of fs watcher#572
Merged
mhevery merged 2 commits intoangular:masterfrom Jan 12, 2017
Merged
patch fs methods as macrotask, add test cases of fs watcher#572mhevery merged 2 commits intoangular:masterfrom
mhevery merged 2 commits intoangular:masterfrom
Conversation
d2a3ec8 to
0296dc8
Compare
Collaborator
Author
|
I have make some performance test to compare the performance, basically the macrotask-patch version run the same performance with non-patch and wrap-patch version. |
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.
patch fs async methods (open, exists, write...) as macrotask, in previous patch, we use wrap,
in my understanding, patch with wrap vs as macro task, we can both intercept schedule and invoke,
but patch with macroTask can also have the ability to intercept cancelTask and hasTask.
add test cases of fs watcher related methods. Because we already patched EventEmitter, so fs.watch, fs.watchFile, fs.unwatchFile don't need additional patch.
add a generic patch macro task method in util.ts
And in original patch, we patched the fs function with wrap, now we treat them as macrotask, so fs method will make additional callback (invokeTask/scheduleTask etc..) call, it may have some performance impact, I will make some other performance demo to check it.