Skip to content
Closed
Show file tree
Hide file tree
Changes from 1 commit
Commits
Show all changes
24 commits
Select commit Hold shift + click to select a range
8d5f560
benchmark: (arrays) use destructuring
BridgeAR Dec 30, 2017
eb5a92d
benchmark: (assert) use destructuring
BridgeAR Dec 30, 2017
a48a321
benchmark: (url) use destructuring
BridgeAR Dec 30, 2017
52fc567
benchmark: (zlib) use destructuring
BridgeAR Dec 30, 2017
e6eb394
benchmark: (util/v8/vm) use destructuring
BridgeAR Dec 30, 2017
8e977c3
benchmark: (tls) use destructuring
BridgeAR Dec 30, 2017
0d05d11
benchmark: (timers) use destructuring
BridgeAR Dec 30, 2017
912458b
benchmark: (streams) use destructuring
BridgeAR Dec 30, 2017
1cc8db1
benchmark: (querystring) use destructuring
BridgeAR Dec 30, 2017
f30a2bd
benchmark: (process) use destructuring
BridgeAR Dec 30, 2017
b2e8cca
benchmark: (net) use destructuring
BridgeAR Dec 30, 2017
c5879c3
benchmark: (os) use destructuring
BridgeAR Dec 30, 2017
c5a1819
benchmark: (path) use destructuring
BridgeAR Dec 30, 2017
ed55a5e
benchmark: (string_decoder) use destructuring
BridgeAR Dec 30, 2017
430bb2c
benchmark: (http2) use destructuring
BridgeAR Dec 30, 2017
2f49067
benchmark: (misc) use destructuring
BridgeAR Dec 30, 2017
69bfcbc
benchmark: (http) use destructuring
BridgeAR Dec 30, 2017
cdfb609
benchmark: (fs) use destructuring
BridgeAR Dec 30, 2017
abc7eec
benchmark: (es) use destructuring
BridgeAR Dec 30, 2017
3011f0a
benchmark: (events) use destructuring
BridgeAR Dec 30, 2017
f2d920b
benchmark: (buffers) use destructuring
BridgeAR Dec 30, 2017
d766d57
benchmark: (child_process) use destructuring
BridgeAR Dec 30, 2017
59b5962
benchmark: (dgram) use destructuring
BridgeAR Dec 30, 2017
bf6ea9e
benchmark: (async_hooks/dns/cluster/domain/module) use destructuring
BridgeAR Dec 30, 2017
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
Next Next commit
benchmark: (es) use destructuring
  • Loading branch information
BridgeAR committed Jan 19, 2018
commit abc7eec4d07d6c011f3a17eff01782eb3cec4fbd
6 changes: 3 additions & 3 deletions benchmark/es/defaultparams-bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -38,10 +38,10 @@ function runDefaultParams(n) {
bench.end(n / 1e6);
}

function main(conf) {
const n = +conf.millions * 1e6;
function main({ millions, method }) {
const n = millions * 1e6;

switch (conf.method) {
switch (method) {
case '':
// Empty string falls through to next line as default, mostly for tests.
case 'withoutdefaults':
Expand Down
6 changes: 3 additions & 3 deletions benchmark/es/destructuring-bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -34,10 +34,10 @@ function runSwapDestructured(n) {
bench.end(n / 1e6);
}

function main(conf) {
const n = +conf.millions * 1e6;
function main({ millions, method }) {
const n = millions * 1e6;

switch (conf.method) {
switch (method) {
case '':
// Empty string falls through to next line as default, mostly for tests.
case 'swap':
Expand Down
6 changes: 3 additions & 3 deletions benchmark/es/destructuring-object-bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -33,10 +33,10 @@ function runDestructured(n) {
bench.end(n / 1e6);
}

function main(conf) {
const n = +conf.millions * 1e6;
function main({ millions, method }) {
const n = millions * 1e6;

switch (conf.method) {
switch (method) {
case '':
// Empty string falls through to next line as default, mostly for tests.
case 'normal':
Expand Down
8 changes: 3 additions & 5 deletions benchmark/es/foreach-bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -52,17 +52,15 @@ function useForEach(n, items) {
bench.end(n / 1e6);
}

function main(conf) {
const n = +conf.millions * 1e6;
const count = +conf.count;

function main({ millions, count, method }) {
const n = millions * 1e6;
const items = new Array(count);
var i;
var fn;
for (i = 0; i < count; i++)
items[i] = i;

switch (conf.method) {
switch (method) {
case '':
// Empty string falls through to next line as default, mostly for tests.
case 'for':
Expand Down
6 changes: 3 additions & 3 deletions benchmark/es/map-bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -108,10 +108,10 @@ function runMap(n) {
bench.end(n / 1e6);
}

function main(conf) {
const n = +conf.millions * 1e6;
function main({ millions, method }) {
const n = millions * 1e6;

switch (conf.method) {
switch (method) {
case '':
// Empty string falls through to next line as default, mostly for tests.
case 'object':
Expand Down
6 changes: 3 additions & 3 deletions benchmark/es/restparams-bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -60,10 +60,10 @@ function runUseArguments(n) {
bench.end(n / 1e6);
}

function main(conf) {
const n = +conf.millions * 1e6;
function main({ millions, method }) {
const n = millions * 1e6;

switch (conf.method) {
switch (method) {
case '':
// Empty string falls through to next line as default, mostly for tests.
case 'copy':
Expand Down
14 changes: 7 additions & 7 deletions benchmark/es/spread-bench.js
Original file line number Diff line number Diff line change
Expand Up @@ -23,16 +23,16 @@ function makeTest(count, rest) {
}
}

function main(conf) {
const n = +conf.millions * 1e6;
const ctx = conf.context === 'context' ? {} : null;
var fn = makeTest(conf.count, conf.rest);
const args = new Array(conf.count);
function main({ millions, context, count, rest, method }) {
const n = millions * 1e6;
const ctx = context === 'context' ? {} : null;
var fn = makeTest(count, rest);
const args = new Array(count);
var i;
for (i = 0; i < conf.count; i++)
for (i = 0; i < count; i++)
args[i] = i;

switch (conf.method) {
switch (method) {
case '':
// Empty string falls through to next line as default, mostly for tests.
case 'apply':
Expand Down
6 changes: 2 additions & 4 deletions benchmark/es/string-concatenations.js
Original file line number Diff line number Diff line change
Expand Up @@ -17,15 +17,13 @@ const configs = {
const bench = common.createBenchmark(main, configs);


function main(conf) {
const n = +conf.n;

function main({ n, mode }) {
const str = 'abc';
const num = 123;

let string;

switch (conf.mode) {
switch (mode) {
case '':
// Empty string falls through to next line as default, mostly for tests.
case 'multi-concat':
Expand Down
8 changes: 3 additions & 5 deletions benchmark/es/string-repeat.js
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,12 @@ const configs = {

const bench = common.createBenchmark(main, configs);

function main(conf) {
const n = +conf.n;
const size = +conf.size;
const character = conf.encoding === 'ascii' ? 'a' : '\ud83d\udc0e'; // '🐎'
function main({ n, size, encoding, mode }) {
const character = encoding === 'ascii' ? 'a' : '\ud83d\udc0e'; // '🐎'

let str;

switch (conf.mode) {
switch (mode) {
case '':
// Empty string falls through to next line as default, mostly for tests.
case 'Array':
Expand Down