-
Notifications
You must be signed in to change notification settings - Fork 29.8k
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: rest operator benchmark #18442
Conversation
Does Maybe @nodejs/v8 will be interested as per https://medium.com/the-node-js-collection/modernizing-node-js-with-idiomatic-javascript-f18d984dcf93 ( |
Will try on Canary next |
Minor nit: shouldn't "rest" be "spread" here? |
benchmark/es/rest-assign.js
Outdated
const util = require('util'); | ||
|
||
const bench = common.createBenchmark(main, { | ||
method: ['rest', 'assign', '_extend'], |
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.
_extend
-> extend
, otherwise Error: Unexpected method
FWIW, quick comparison for V8 6.1 – 6.6 (Windows 7 x64): data:
|
ping @bmeurer re: the decline in performance mentioned above for object spread. |
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.
Small nits: rest operator
-> spread operator
.
In fact there is no rest operator
but rest parameter
:-)
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.
LGTM with @vsemozhetbyt's comment addressed.
Ping @jasnell |
Benchmark comparing `util._extend()`, `Object.assign()`, and the rest operator for object assignment. `util._extend()` still wins currently.
b975ffa
to
61b67bc
Compare
Benchmark comparing `util._extend()`, `Object.assign()`, and the spread operator for object assignment. `util._extend()` still wins currently. PR-URL: #18442 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Landed in 84cc832 |
Benchmark comparing `util._extend()`, `Object.assign()`, and the spread operator for object assignment. `util._extend()` still wins currently. PR-URL: #18442 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Benchmark comparing `util._extend()`, `Object.assign()`, and the spread operator for object assignment. `util._extend()` still wins currently. PR-URL: #18442 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Benchmark comparing `util._extend()`, `Object.assign()`, and the spread operator for object assignment. `util._extend()` still wins currently. PR-URL: #18442 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Benchmark comparing `util._extend()`, `Object.assign()`, and the spread operator for object assignment. `util._extend()` still wins currently. PR-URL: #18442 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Should this be backported to |
Benchmark comparing `util._extend()`, `Object.assign()`, and the spread operator for object assignment. `util._extend()` still wins currently. PR-URL: nodejs#18442 Reviewed-By: Colin Ihrig <cjihrig@gmail.com> Reviewed-By: Weijia Wang <starkwang@126.com> Reviewed-By: Luigi Pinca <luigipinca@gmail.com> Reviewed-By: Ruben Bridgewater <ruben@bridgewater.de> Reviewed-By: Yuta Hiroto <hello@about-hiroppy.com>
Benchmark comparing
util._extend()
,Object.assign()
, and the rest operator for object assignment (e.g.{ ...src }
).util._extend()
still wins currently.Checklist
make -j4 test
(UNIX), orvcbuild test
(Windows) passesAffected core subsystem(s)
benchmarks