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

benchmark: rest operator benchmark #18442

Closed
wants to merge 2 commits into from
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
[Squash] Nits
jasnell committed Feb 1, 2018
commit 61b67bcde486152bc01760716b9b61607f4d9853
6 changes: 3 additions & 3 deletions benchmark/es/rest-assign.js → benchmark/es/spread-assign.js
Original file line number Diff line number Diff line change
@@ -5,7 +5,7 @@ const assert = require('assert');
const util = require('util');

const bench = common.createBenchmark(main, {
method: ['rest', 'assign', '_extend'],
method: ['spread', 'assign', '_extend'],
count: [5, 10, 20],
millions: [1]
});
@@ -23,7 +23,7 @@ function main({ millions, context, count, rest, method }) {
switch (method) {
case '':
// Empty string falls through to next line as default, mostly for tests.
case 'extend':
case '_extend':
bench.start();
for (i = 0; i < n; i++)
obj = util._extend({}, src);
@@ -35,7 +35,7 @@ function main({ millions, context, count, rest, method }) {
obj = Object.assign({}, src);
bench.end(n);
break;
case 'rest':
case 'spread':
bench.start();
for (i = 0; i < n; i++)
obj = { ...src };