-
Notifications
You must be signed in to change notification settings - Fork 29.7k
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
benchmark: avoid TurboFan deopt in arrays bench #11894
Conversation
Something unidentified at the moment is causing the arrays benchmarks to deopt when run with the TurboFan compiler. Refactor the test to use an inner function that can be correctly optimized by TurboFan and Crankshaft. Refs: nodejs#11851 (comment)
There are other benchmarks with the same issue. For example https://github.com/nodejs/node/blob/master/benchmark/assert/deepequal-prims-and-objs-big-array.js#L36. This one is optimized I think during the loop to initialize the arrays. Then it deopts when it reaches |
If we backport these changes, we'd want to make sure that |
Ping @mscdex ... is that an objection to landing this or does it LGTY? |
I'm +0 really, the functions don't get compiled by TurboFan currently (tested with node v6.x, master with V8 5.6 and 5.7) unless forced via V8 command line options. I would guess that this is because the V8 team knows about such deopts and has not enabled TurboFan for those situations. |
I'm not sure we necessarily want the |
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.
awesome work.
LGTM
A linter run is enough, right? |
Something unidentified at the moment is causing the arrays benchmarks to deopt when run with the TurboFan compiler. Refactor the test to use an inner function that can be correctly optimized by TurboFan and Crankshaft. PR-URL: #11894 Ref: #11851 (comment) Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
Landed in eefdf45 |
Something unidentified at the moment is causing the arrays benchmarks to deopt when run with the TurboFan compiler. Refactor the test to use an inner function that can be correctly optimized by TurboFan and Crankshaft. PR-URL: nodejs#11894 Ref: nodejs#11851 (comment) Reviewed-By: James M Snell <[email protected]> Reviewed-By: Matteo Collina <[email protected]>
assuming we don't need to backport this to v6. thoughts? |
Something unidentified at the moment is causing the arrays benchmarks to
deopt when run with the TurboFan compiler. Refactor the test to use an
inner function that can be correctly optimized by TurboFan and
Crankshaft.
I think this change also makes the benchmarks generally better. I will optimize the
run
function instead of the wholemain
that is run only once anyway.Refs: #11851 (comment)
Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
benchmark