-
-
Notifications
You must be signed in to change notification settings - Fork 16.3k
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
Optimize JSON.stringify
performance in V8.
#2900
Conversation
Older versions of V8 have a bug [1] where using empty `replacer` or `space` arguments decreases performance. [1]: https://bugs.chromium.org/p/v8/issues/detail?id=4730
Nice 👍 |
Very interesting, didn't know there was a separate code path based on argument count. I think this is a good change, and unless there is an objection, slated to 4.14 |
lgtm |
Any updates? |
LGTM |
Hi @demoneaux, we are planning to add this into the 4.14 release. We are working on documenting our release process and will be merging your pull request into an appropriate branch soon. |
Just keep in mind that this is automatically resolved in upcoming Node versions with the inclusion of newer V8 engine. So while it's an optimization today (and by all means, go for it), it will be noise in the future. You may want to add a code comment stating from which V8 version this workaround is no longer needed (and I forgot which version... not very helpful am I?). |
LGTM |
2 months in. Still working on the documentation? Just curious. |
Node 6 should not have this performance issue btw. |
This change looks good to me. It would be neat if we could get a comment in the code to understand when we can eventually remove this conditional (like what v8 or even Node.js version it's fixed in), but that would not bar getting this landed in the 4.14 release :) The 4.14 branch was created, and we'll get a 4.14 release pull request going from there with this change. @expressjs/express-tc anyone have thoughts on when to close pull requests that are not merged on
Typically I have heard the following arguments against each of those:
|
@demoneaux, which older versions of V8/Node are affected? @dougwilson I am in favor of option 1, with a comment that it has been merged on a branch, and will eventually make it to master. |
I believe Node pre-6 is affected by this issue. |
Older versions of V8 have a bug 1 where using empty
replacer
orspace
arguments decreases performance.