Skip to content
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

Closed
wants to merge 4 commits into from
Closed

console: using class #9068

wants to merge 4 commits into from

Conversation

Naltox
Copy link

@Naltox Naltox commented Oct 12, 2016

Checklist
  • make -j8 test (UNIX), or vcbuild test nosign (Windows) passes
  • tests and/or benchmarks are included
  • commit message follows commit guidelines
Description of change

Just rewritten Console using ES6 class.

@nodejs-github-bot nodejs-github-bot added the console Issues and PRs related to the console subsystem. label Oct 12, 2016
@addaleax addaleax added the semver-major PRs that contain breaking changes and should be released in the next major version. label Oct 12, 2016
class Console {
constructor(stdout, stderr) {
if (!(this instanceof Console))
return new Console(stdout, stderr);
Copy link
Member

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.

Copy link
Author

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?

@Naltox Naltox changed the title Console using class console: using class Oct 12, 2016
// 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) {
Copy link
Contributor

@mscdex mscdex Oct 12, 2016

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.

@mscdex
Copy link
Contributor

mscdex commented Oct 12, 2016

Have you performed benchmarks that tests these changes?

@Fishrock123
Copy link
Contributor

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 class?

@MylesBorins
Copy link
Contributor

-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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
console Issues and PRs related to the console subsystem. semver-major PRs that contain breaking changes and should be released in the next major version.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

6 participants