-
- Notifications
You must be signed in to change notification settings - Fork 33.7k
util: avoid out-of-bounds arguments index access #10569
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
not-an-aardvark merged 1 commit into nodejs:master from not-an-aardvark:util-inspect-arguments Jan 5, 2017
Merged
util: avoid out-of-bounds arguments index access #10569
not-an-aardvark merged 1 commit into nodejs:master from not-an-aardvark:util-inspect-arguments Jan 5, 2017
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
Contributor Author
Contributor Author
| Benchmark results: Without this change: $ for ((i=0;i<10;i+=1)); do ./node benchmark/util/inspect.js; done util/inspect.js n=5000000: 59,923 util/inspect.js n=5000000: 68,489 util/inspect.js n=5000000: 66,138 util/inspect.js n=5000000: 68,259 util/inspect.js n=5000000: 66,395 util/inspect.js n=5000000: 64,827 util/inspect.js n=5000000: 69,548 util/inspect.js n=5000000: 73,541 util/inspect.js n=5000000: 66,892 util/inspect.js n=5000000: 65,717With this change: $ for ((i=0;i<10;i+=1)); do ./node benchmark/util/inspect.js; done util/inspect.js n=5000000: 73,957 util/inspect.js n=5000000: 74,728 util/inspect.js n=5000000: 73,496 util/inspect.js n=5000000: 73,604 util/inspect.js n=5000000: 74,919 util/inspect.js n=5000000: 66,369 util/inspect.js n=5000000: 78,040 util/inspect.js n=5000000: 70,583 util/inspect.js n=5000000: 72,164 util/inspect.js n=5000000: 71,974 |
cjihrig approved these changes Jan 2, 2017
bc775d0 to b222ee7 Compare Contributor Author
| Accidentally pushed an older commit that didn't contain local changes, so CI failed. Re-pushed, new CI: https://ci.nodejs.org/job/node-test-pull-request/5657/ |
evanlucas approved these changes Jan 2, 2017
Contributor
| LGTM |
1 similar comment
Contributor
| LGTM |
Fishrock123 approved these changes Jan 3, 2017
jasnell approved these changes Jan 3, 2017
Member
| Previous CI run had some red... running again just to be safe: https://ci.nodejs.org/job/node-test-pull-request/5701/ |
This updates util.inspect() to avoid accessing out-of-range indices of the `arguments` object, which is known to cause optimization bailout. Based on an average of 10 runs of the benchmark in `benchmark/util/inspect.js`, this change improves the performance of `util.inspect` by about 10%. Relates to nodejs#10323 PR-URL: nodejs#10569 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Jackson Tian <shyvo1987@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
b222ee7 to 26f2a6e Compare Contributor Author
| Landed in 26f2a6e |
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 18, 2017
This updates util.inspect() to avoid accessing out-of-range indices of the `arguments` object, which is known to cause optimization bailout. Based on an average of 10 runs of the benchmark in `benchmark/util/inspect.js`, this change improves the performance of `util.inspect` by about 10%. Relates to nodejs#10323 PR-URL: nodejs#10569 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Jackson Tian <shyvo1987@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 19, 2017
This updates util.inspect() to avoid accessing out-of-range indices of the `arguments` object, which is known to cause optimization bailout. Based on an average of 10 runs of the benchmark in `benchmark/util/inspect.js`, this change improves the performance of `util.inspect` by about 10%. Relates to nodejs#10323 PR-URL: nodejs#10569 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Jackson Tian <shyvo1987@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 24, 2017
This updates util.inspect() to avoid accessing out-of-range indices of the `arguments` object, which is known to cause optimization bailout. Based on an average of 10 runs of the benchmark in `benchmark/util/inspect.js`, this change improves the performance of `util.inspect` by about 10%. Relates to nodejs#10323 PR-URL: nodejs#10569 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Jackson Tian <shyvo1987@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
italoacasas pushed a commit to italoacasas/node that referenced this pull request Jan 27, 2017
This updates util.inspect() to avoid accessing out-of-range indices of the `arguments` object, which is known to cause optimization bailout. Based on an average of 10 runs of the benchmark in `benchmark/util/inspect.js`, this change improves the performance of `util.inspect` by about 10%. Relates to nodejs#10323 PR-URL: nodejs#10569 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Evan Lucas <evanlucas@me.com> Reviewed-By: Brian White <mscdex@mscdex.net> Reviewed-By: Jackson Tian <shyvo1987@gmail.com> Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com> Reviewed-By: James M Snell <jasnell@gmail.com>
Merged
Contributor
| should this be backported? |
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
performance Issues and PRs related to the performance of Node.js. util Issues and PRs related to the built-in util module.
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.
This updates util.inspect() to avoid accessing out-of-range indices of the
argumentsobject, which is known to cause optimization bailout.Based on an average of 10 runs of the benchmark in
benchmark/util/inspect.js, this change improves the performance ofutil.inspectby about 10%.Relates to #10323
Checklist
make -j4 test(UNIX), orvcbuild test(Windows) passesAffected core subsystem(s)
util