-
Notifications
You must be signed in to change notification settings - Fork 30k
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
console: using class #9068
console: using class #9068
Conversation
class Console { | ||
constructor(stdout, stderr) { | ||
if (!(this instanceof Console)) | ||
return new Console(stdout, stderr); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This part is not going to work, so you can leave it out from this PR.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You mean 7, 8 lines?
// As of v8 5.0.71.32, the combination of rest param, template string | ||
// and .apply(null, args) benchmarks consistently faster than using | ||
// the spread operator when calling util.format. | ||
log(...args) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I believe this is still slow, even with V8 5.4 currently in master.
Ditto for the other rest args uses.
Have you performed benchmarks that tests these changes? |
This change will likely be difficult to backport, just changing it is of little value.... was anything else improved? Can it be improved without using |
-1 on this for the moment. Large rewrites like this across the code base are prone to error and make debugging harder as it will completely wash the blame on the document. There are also potential performance concerns as mentioned by @mscdex further, since it is semver major, this is going to make any backporting unnecessarily difficult What are the reasons for the change aside from adopting new features |
Checklist
make -j8 test
(UNIX), orvcbuild test nosign
(Windows) passesDescription of change
Just rewritten Console using ES6 class.