diff --git a/.eslintrc.js b/.eslintrc.js index 2250fdba77ef7f..e7276ad01d298d 100644 --- a/.eslintrc.js +++ b/.eslintrc.js @@ -147,6 +147,7 @@ module.exports = { message: '__defineSetter__ is deprecated.', } ], + /* eslint-disable max-len, quotes */ 'no-restricted-syntax': [ 'error', diff --git a/Makefile b/Makefile index 89739f3eadeb45..f1df74c2c2dbec 100644 --- a/Makefile +++ b/Makefile @@ -203,7 +203,7 @@ coverage-test: coverage-build (cd lib && .$(NODE) ../node_modules/.bin/nyc report \ --temp-directory "$(CURDIR)/.cov_tmp" \ --report-dir "../coverage") - -(cd out && "../gcovr/scripts/gcovr" --gcov-exclude='.*deps' \ + -(cd out && PYTHONPATH=$(CURDIR)/gcovr $(PYTHON) -m gcovr --gcov-exclude='.*deps' \ --gcov-exclude='.*usr' -v -r Release/obj.target \ --html --html-detail -o ../coverage/cxxcoverage.html \ --gcov-executable="$(GCOV)") diff --git a/benchmark/buffers/buffer-compare-instance-method.js b/benchmark/buffers/buffer-compare-instance-method.js index a3433803b79537..77a3e84fa70344 100644 --- a/benchmark/buffers/buffer-compare-instance-method.js +++ b/benchmark/buffers/buffer-compare-instance-method.js @@ -4,11 +4,10 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { size: [16, 512, 1024, 4096, 16386], args: [1, 2, 3, 4, 5], - millions: [1] + n: [1e6] }); -function main({ millions, size, args }) { - const iter = millions * 1e6; +function main({ n, size, args }) { const b0 = Buffer.alloc(size, 'a'); const b1 = Buffer.alloc(size, 'a'); const b0Len = b0.length; @@ -37,41 +36,41 @@ function main({ millions, size, args }) { case 2: b0.compare(b1, 0); bench.start(); - for (i = 0; i < iter; i++) { + for (i = 0; i < n; i++) { b0.compare(b1, 0); } - bench.end(iter / 1e6); + bench.end(n); break; case 3: b0.compare(b1, 0, b1Len); bench.start(); - for (i = 0; i < iter; i++) { + for (i = 0; i < n; i++) { b0.compare(b1, 0, b1Len); } - bench.end(iter / 1e6); + bench.end(n); break; case 4: b0.compare(b1, 0, b1Len, 0); bench.start(); - for (i = 0; i < iter; i++) { + for (i = 0; i < n; i++) { b0.compare(b1, 0, b1Len, 0); } - bench.end(iter / 1e6); + bench.end(n); break; case 5: b0.compare(b1, 0, b1Len, 0, b0Len); bench.start(); - for (i = 0; i < iter; i++) { + for (i = 0; i < n; i++) { b0.compare(b1, 0, b1Len, 0, b0Len); } - bench.end(iter / 1e6); + bench.end(n); break; default: b0.compare(b1); bench.start(); - for (i = 0; i < iter; i++) { + for (i = 0; i < n; i++) { b0.compare(b1); } - bench.end(iter / 1e6); + bench.end(n); } } diff --git a/benchmark/buffers/buffer-compare-offset.js b/benchmark/buffers/buffer-compare-offset.js index 551fcd2f0cec37..89cc4427d9a24c 100644 --- a/benchmark/buffers/buffer-compare-offset.js +++ b/benchmark/buffers/buffer-compare-offset.js @@ -4,7 +4,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { method: ['offset', 'slice'], size: [16, 512, 1024, 4096, 16386], - millions: [1] + n: [1e6] }); function compareUsingSlice(b0, b1, len, iter) { @@ -17,13 +17,12 @@ function compareUsingOffset(b0, b1, len, iter) { b0.compare(b1, 1, len, 1, len); } -function main({ millions, size, method }) { - const iter = millions * 1e6; +function main({ n, size, method }) { const fn = method === 'slice' ? compareUsingSlice : compareUsingOffset; bench.start(); fn(Buffer.alloc(size, 'a'), Buffer.alloc(size, 'b'), size >> 1, - iter); - bench.end(millions); + n); + bench.end(n); } diff --git a/benchmark/buffers/buffer-compare.js b/benchmark/buffers/buffer-compare.js index f7abb4b3d94ffa..cb4f0f475c94ae 100644 --- a/benchmark/buffers/buffer-compare.js +++ b/benchmark/buffers/buffer-compare.js @@ -24,19 +24,18 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { size: [16, 512, 1024, 4096, 16386], - millions: [1] + n: [1e6] }); -function main({ millions, size }) { - const iter = millions * 1e6; +function main({ n, size }) { const b0 = Buffer.alloc(size, 'a'); const b1 = Buffer.alloc(size, 'a'); b1[size - 1] = 'b'.charCodeAt(0); bench.start(); - for (var i = 0; i < iter; i++) { + for (var i = 0; i < n; i++) { Buffer.compare(b0, b1); } - bench.end(iter / 1e6); + bench.end(n); } diff --git a/benchmark/buffers/buffer-read-float.js b/benchmark/buffers/buffer-read-float.js index e105642972d857..dbccf57393f6f2 100644 --- a/benchmark/buffers/buffer-read-float.js +++ b/benchmark/buffers/buffer-read-float.js @@ -5,10 +5,10 @@ const bench = common.createBenchmark(main, { type: ['Double', 'Float'], endian: ['BE', 'LE'], value: ['zero', 'big', 'small', 'inf', 'nan'], - millions: [1] + n: [1e6] }); -function main({ millions, type, endian, value }) { +function main({ n, type, endian, value }) { type = type || 'Double'; const buff = Buffer.alloc(8); const fn = `read${type}${endian}`; @@ -32,8 +32,8 @@ function main({ millions, type, endian, value }) { buff[`write${type}${endian}`](values[type][value], 0); bench.start(); - for (var i = 0; i !== millions * 1e6; i++) { + for (var i = 0; i !== n; i++) { buff[fn](0); } - bench.end(millions); + bench.end(n); } diff --git a/benchmark/buffers/buffer-read-with-byteLength.js b/benchmark/buffers/buffer-read-with-byteLength.js index 1858c4fd965e26..93deab2ab037fe 100644 --- a/benchmark/buffers/buffer-read-with-byteLength.js +++ b/benchmark/buffers/buffer-read-with-byteLength.js @@ -11,19 +11,19 @@ const types = [ const bench = common.createBenchmark(main, { buffer: ['fast', 'slow'], type: types, - millions: [1], + n: [1e6], byteLength: [1, 2, 3, 4, 5, 6] }); -function main({ millions, buf, type, byteLength }) { +function main({ n, buf, type, byteLength }) { const clazz = buf === 'fast' ? Buffer : require('buffer').SlowBuffer; const buff = new clazz(8); const fn = `read${type || 'IntBE'}`; buff.writeDoubleLE(0, 0); bench.start(); - for (var i = 0; i !== millions * 1e6; i++) { + for (var i = 0; i !== n; i++) { buff[fn](0, byteLength); } - bench.end(millions); + bench.end(n); } diff --git a/benchmark/buffers/buffer-read.js b/benchmark/buffers/buffer-read.js index 88a46cb29079f6..eccbdc507d6fa2 100644 --- a/benchmark/buffers/buffer-read.js +++ b/benchmark/buffers/buffer-read.js @@ -21,18 +21,19 @@ const types = [ const bench = common.createBenchmark(main, { buffer: ['fast', 'slow'], type: types, - millions: [1] + n: [1e6] }); -function main({ millions, buf, type }) { +function main({ n, buf, type }) { const clazz = buf === 'fast' ? Buffer : require('buffer').SlowBuffer; const buff = new clazz(8); const fn = `read${type || 'UInt8'}`; buff.writeDoubleLE(0, 0); bench.start(); - for (var i = 0; i !== millions * 1e6; i++) { + + for (var i = 0; i !== n; i++) { buff[fn](0); } - bench.end(millions); + bench.end(n); } diff --git a/benchmark/buffers/buffer-write.js b/benchmark/buffers/buffer-write.js index 42ea9aa093cb88..de27dc8211b613 100644 --- a/benchmark/buffers/buffer-write.js +++ b/benchmark/buffers/buffer-write.js @@ -25,7 +25,7 @@ const types = [ const bench = common.createBenchmark(main, { buffer: ['fast', 'slow'], type: types, - millions: [1] + n: [1e6] }); const INT8 = 0x7f; @@ -59,42 +59,42 @@ const byteLength = { writeIntBE: 6 }; -function main({ millions, buf, type }) { +function main({ n, buf, type }) { const clazz = buf === 'fast' ? Buffer : require('buffer').SlowBuffer; const buff = new clazz(8); const fn = `write${type || 'UInt8'}`; if (!/\d/.test(fn)) - benchSpecialInt(buff, fn, millions); + benchSpecialInt(buff, fn, n); else if (/Int/.test(fn)) - benchInt(buff, fn, millions); + benchInt(buff, fn, n); else - benchFloat(buff, fn, millions); + benchFloat(buff, fn, n); } -function benchInt(buff, fn, millions) { +function benchInt(buff, fn, n) { const m = mod[fn]; bench.start(); - for (var i = 0; i !== millions * 1e6; i++) { + for (var i = 0; i !== n; i++) { buff[fn](i & m, 0); } - bench.end(millions); + bench.end(n); } -function benchSpecialInt(buff, fn, millions) { +function benchSpecialInt(buff, fn, n) { const m = mod[fn]; const byte = byteLength[fn]; bench.start(); - for (var i = 0; i !== millions * 1e6; i++) { + for (var i = 0; i !== n; i++) { buff[fn](i & m, 0, byte); } - bench.end(millions); + bench.end(n); } -function benchFloat(buff, fn, millions) { +function benchFloat(buff, fn, n) { bench.start(); - for (var i = 0; i !== millions * 1e6; i++) { + for (var i = 0; i !== n; i++) { buff[fn](i, 0); } - bench.end(millions); + bench.end(n); } diff --git a/benchmark/buffers/dataview-set.js b/benchmark/buffers/dataview-set.js index ee5acfb1c1f72c..00a7114bddd860 100644 --- a/benchmark/buffers/dataview-set.js +++ b/benchmark/buffers/dataview-set.js @@ -20,7 +20,7 @@ const types = [ const bench = common.createBenchmark(main, { type: types, - millions: [1] + n: [1e6] }); const INT8 = 0x7f; @@ -39,18 +39,17 @@ const mod = { setUint32: UINT32 }; -function main({ millions, type }) { +function main({ n, type }) { type = type || 'Uint8'; - const len = millions * 1e6; const ab = new ArrayBuffer(8); const dv = new DataView(ab, 0, 8); const le = /LE$/.test(type); const fn = `set${type.replace(/[LB]E$/, '')}`; if (/int/i.test(fn)) - benchInt(dv, fn, len, le); + benchInt(dv, fn, n, le); else - benchFloat(dv, fn, len, le); + benchFloat(dv, fn, n, le); } function benchInt(dv, fn, len, le) { @@ -60,7 +59,7 @@ function benchInt(dv, fn, len, le) { for (var i = 0; i < len; i++) { method.call(dv, 0, i % m, le); } - bench.end(len / 1e6); + bench.end(len); } function benchFloat(dv, fn, len, le) { @@ -69,5 +68,5 @@ function benchFloat(dv, fn, len, le) { for (var i = 0; i < len; i++) { method.call(dv, 0, i * 0.1, le); } - bench.end(len / 1e6); + bench.end(len); } diff --git a/benchmark/es/defaultparams-bench.js b/benchmark/es/defaultparams-bench.js index a00b50137c1af3..c568c12ae03fda 100644 --- a/benchmark/es/defaultparams-bench.js +++ b/benchmark/es/defaultparams-bench.js @@ -5,7 +5,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { method: ['withoutdefaults', 'withdefaults'], - millions: [100] + n: [1e8] }); function oldStyleDefaults(x, y) { @@ -20,29 +20,29 @@ function defaultParams(x = 1, y = 2) { assert.strictEqual(y, 2); } -function runOldStyleDefaults(millions) { +function runOldStyleDefaults(n) { bench.start(); - for (var i = 0; i < millions * 1e6; i++) + for (var i = 0; i < n; i++) oldStyleDefaults(); - bench.end(millions); + bench.end(n); } -function runDefaultParams(millions) { +function runDefaultParams(n) { bench.start(); - for (var i = 0; i < millions * 1e6; i++) + for (var i = 0; i < n; i++) defaultParams(); - bench.end(millions); + bench.end(n); } -function main({ millions, method }) { +function main({ n, method }) { switch (method) { case '': // Empty string falls through to next line as default, mostly for tests. case 'withoutdefaults': - runOldStyleDefaults(millions); + runOldStyleDefaults(n); break; case 'withdefaults': - runDefaultParams(millions); + runDefaultParams(n); break; default: throw new Error(`Unexpected method "${method}"`); diff --git a/benchmark/es/destructuring-bench.js b/benchmark/es/destructuring-bench.js index 2168940bdc44f0..37f3fd9ad3d601 100644 --- a/benchmark/es/destructuring-bench.js +++ b/benchmark/es/destructuring-bench.js @@ -5,13 +5,13 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { method: ['swap', 'destructure'], - millions: [100] + n: [1e8] }); -function runSwapManual(millions) { +function runSwapManual(n) { var x, y, r; bench.start(); - for (var i = 0; i < millions * 1e6; i++) { + for (var i = 0; i < n; i++) { x = 1, y = 2; r = x; x = y; @@ -19,30 +19,30 @@ function runSwapManual(millions) { assert.strictEqual(x, 2); assert.strictEqual(y, 1); } - bench.end(millions); + bench.end(n); } -function runSwapDestructured(millions) { +function runSwapDestructured(n) { var x, y; bench.start(); - for (var i = 0; i < millions * 1e6; i++) { + for (var i = 0; i < n; i++) { x = 1, y = 2; [x, y] = [y, x]; assert.strictEqual(x, 2); assert.strictEqual(y, 1); } - bench.end(millions); + bench.end(n); } -function main({ millions, method }) { +function main({ n, method }) { switch (method) { case '': // Empty string falls through to next line as default, mostly for tests. case 'swap': - runSwapManual(millions); + runSwapManual(n); break; case 'destructure': - runSwapDestructured(millions); + runSwapDestructured(n); break; default: throw new Error(`Unexpected method "${method}"`); diff --git a/benchmark/es/destructuring-object-bench.js b/benchmark/es/destructuring-object-bench.js index a84977c59bc2cd..0c5615fd1e667b 100644 --- a/benchmark/es/destructuring-object-bench.js +++ b/benchmark/es/destructuring-object-bench.js @@ -4,44 +4,44 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { method: ['normal', 'destructureObject'], - millions: [100] + n: [1e8] }); -function runNormal(millions) { +function runNormal(n) { var i = 0; const o = { x: 0, y: 1 }; bench.start(); - for (; i < millions * 1e6; i++) { + for (; i < n; i++) { /* eslint-disable no-unused-vars */ const x = o.x; const y = o.y; const r = o.r || 2; /* eslint-enable no-unused-vars */ } - bench.end(millions); + bench.end(n); } -function runDestructured(millions) { +function runDestructured(n) { var i = 0; const o = { x: 0, y: 1 }; bench.start(); - for (; i < millions * 1e6; i++) { + for (; i < n; i++) { /* eslint-disable no-unused-vars */ const { x, y, r = 2 } = o; /* eslint-enable no-unused-vars */ } - bench.end(millions); + bench.end(n); } -function main({ millions, method }) { +function main({ n, method }) { switch (method) { case '': // Empty string falls through to next line as default, mostly for tests. case 'normal': - runNormal(millions); + runNormal(n); break; case 'destructureObject': - runDestructured(millions); + runDestructured(n); break; default: throw new Error(`Unexpected method "${method}"`); diff --git a/benchmark/es/foreach-bench.js b/benchmark/es/foreach-bench.js index e9179ed8dedb6d..25ea97b44d5695 100644 --- a/benchmark/es/foreach-bench.js +++ b/benchmark/es/foreach-bench.js @@ -5,51 +5,51 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { method: ['for', 'for-of', 'for-in', 'forEach'], count: [5, 10, 20, 100], - millions: [5] + n: [5e6] }); -function useFor(millions, items, count) { +function useFor(n, items, count) { bench.start(); - for (var i = 0; i < millions * 1e6; i++) { + for (var i = 0; i < n; i++) { for (var j = 0; j < count; j++) { /* eslint-disable no-unused-vars */ const item = items[j]; /* esline-enable no-unused-vars */ } } - bench.end(millions); + bench.end(n); } -function useForOf(millions, items) { +function useForOf(n, items) { var item; bench.start(); - for (var i = 0; i < millions * 1e6; i++) { + for (var i = 0; i < n; i++) { for (item of items) {} } - bench.end(millions); + bench.end(n); } -function useForIn(millions, items) { +function useForIn(n, items) { bench.start(); - for (var i = 0; i < millions * 1e6; i++) { + for (var i = 0; i < n; i++) { for (var j in items) { /* eslint-disable no-unused-vars */ const item = items[j]; /* esline-enable no-unused-vars */ } } - bench.end(millions); + bench.end(n); } -function useForEach(millions, items) { +function useForEach(n, items) { bench.start(); - for (var i = 0; i < millions * 1e6; i++) { + for (var i = 0; i < n; i++) { items.forEach((item) => {}); } - bench.end(millions); + bench.end(n); } -function main({ millions, count, method }) { +function main({ n, count, method }) { const items = new Array(count); var fn; for (var i = 0; i < count; i++) @@ -73,5 +73,5 @@ function main({ millions, count, method }) { default: throw new Error(`Unexpected method "${method}"`); } - fn(millions, items, count); + fn(n, items, count); } diff --git a/benchmark/es/map-bench.js b/benchmark/es/map-bench.js index 445031aa9831de..d34010c6d53f4f 100644 --- a/benchmark/es/map-bench.js +++ b/benchmark/es/map-bench.js @@ -8,62 +8,62 @@ const bench = common.createBenchmark(main, { 'object', 'nullProtoObject', 'nullProtoLiteralObject', 'storageObject', 'fakeMap', 'map' ], - millions: [1] + n: [1e6] }); -function runObject(millions) { +function runObject(n) { const m = {}; bench.start(); - for (var i = 0; i < millions * 1e6; i++) { + for (var i = 0; i < n; i++) { m[`i${i}`] = i; m[`s${i}`] = String(i); assert.strictEqual(String(m[`i${i}`]), m[`s${i}`]); m[`i${i}`] = undefined; m[`s${i}`] = undefined; } - bench.end(millions); + bench.end(n); } -function runNullProtoObject(millions) { +function runNullProtoObject(n) { const m = Object.create(null); bench.start(); - for (var i = 0; i < millions * 1e6; i++) { + for (var i = 0; i < n; i++) { m[`i${i}`] = i; m[`s${i}`] = String(i); assert.strictEqual(String(m[`i${i}`]), m[`s${i}`]); m[`i${i}`] = undefined; m[`s${i}`] = undefined; } - bench.end(millions); + bench.end(n); } -function runNullProtoLiteralObject(millions) { +function runNullProtoLiteralObject(n) { const m = { __proto__: null }; bench.start(); - for (var i = 0; i < millions * 1e6; i++) { + for (var i = 0; i < n; i++) { m[`i${i}`] = i; m[`s${i}`] = String(i); assert.strictEqual(String(m[`i${i}`]), m[`s${i}`]); m[`i${i}`] = undefined; m[`s${i}`] = undefined; } - bench.end(millions); + bench.end(n); } function StorageObject() {} StorageObject.prototype = Object.create(null); -function runStorageObject(millions) { +function runStorageObject(n) { const m = new StorageObject(); bench.start(); - for (var i = 0; i < millions * 1e6; i++) { + for (var i = 0; i < n; i++) { m[`i${i}`] = i; m[`s${i}`] = String(i); assert.strictEqual(String(m[`i${i}`]), m[`s${i}`]); m[`i${i}`] = undefined; m[`s${i}`] = undefined; } - bench.end(millions); + bench.end(n); } function fakeMap() { @@ -76,53 +76,53 @@ function fakeMap() { }; } -function runFakeMap(millions) { +function runFakeMap(n) { const m = fakeMap(); bench.start(); - for (var i = 0; i < millions * 1e6; i++) { + for (var i = 0; i < n; i++) { m.set(`i${i}`, i); m.set(`s${i}`, String(i)); assert.strictEqual(String(m.get(`i${i}`)), m.get(`s${i}`)); m.set(`i${i}`, undefined); m.set(`s${i}`, undefined); } - bench.end(millions); + bench.end(n); } -function runMap(millions) { +function runMap(n) { const m = new Map(); bench.start(); - for (var i = 0; i < millions * 1e6; i++) { + for (var i = 0; i < n; i++) { m.set(`i${i}`, i); m.set(`s${i}`, String(i)); assert.strictEqual(String(m.get(`i${i}`)), m.get(`s${i}`)); m.set(`i${i}`, undefined); m.set(`s${i}`, undefined); } - bench.end(millions); + bench.end(n); } -function main({ millions, method }) { +function main({ n, method }) { switch (method) { case '': // Empty string falls through to next line as default, mostly for tests. case 'object': - runObject(millions); + runObject(n); break; case 'nullProtoObject': - runNullProtoObject(millions); + runNullProtoObject(n); break; case 'nullProtoLiteralObject': - runNullProtoLiteralObject(millions); + runNullProtoLiteralObject(n); break; case 'storageObject': - runStorageObject(millions); + runStorageObject(n); break; case 'fakeMap': - runFakeMap(millions); + runFakeMap(n); break; case 'map': - runMap(millions); + runMap(n); break; default: throw new Error(`Unexpected method "${method}"`); diff --git a/benchmark/es/restparams-bench.js b/benchmark/es/restparams-bench.js index 6ad766f10f16f6..d9b4878cb316a0 100644 --- a/benchmark/es/restparams-bench.js +++ b/benchmark/es/restparams-bench.js @@ -5,7 +5,7 @@ const assert = require('assert'); const bench = common.createBenchmark(main, { method: ['copy', 'rest', 'arguments'], - millions: [100] + n: [1e8] }); function copyArguments() { @@ -33,22 +33,22 @@ function useArguments() { assert.strictEqual(arguments[3], 'b'); } -function runCopyArguments(millions) { - for (var i = 0; i < millions * 1e6; i++) +function runCopyArguments(n) { + for (var i = 0; i < n; i++) copyArguments(1, 2, 'a', 'b'); } -function runRestArguments(millions) { - for (var i = 0; i < millions * 1e6; i++) +function runRestArguments(n) { + for (var i = 0; i < n; i++) restArguments(1, 2, 'a', 'b'); } -function runUseArguments(millions) { - for (var i = 0; i < millions * 1e6; i++) +function runUseArguments(n) { + for (var i = 0; i < n; i++) useArguments(1, 2, 'a', 'b'); } -function main({ millions, method }) { +function main({ n, method }) { var fn; switch (method) { case '': @@ -66,6 +66,6 @@ function main({ millions, method }) { throw new Error(`Unexpected method "${method}"`); } bench.start(); - fn(millions); - bench.end(millions); + fn(n); + bench.end(n); } diff --git a/benchmark/es/spread-assign.js b/benchmark/es/spread-assign.js index 00c634ff879501..3246081ff7197a 100644 --- a/benchmark/es/spread-assign.js +++ b/benchmark/es/spread-assign.js @@ -6,11 +6,10 @@ const util = require('util'); const bench = common.createBenchmark(main, { method: ['spread', 'assign', '_extend'], count: [5, 10, 20], - millions: [1] + n: [1e6] }); -function main({ millions, context, count, rest, method }) { - const n = millions * 1e6; +function main({ n, context, count, rest, method }) { const src = {}; for (let n = 0; n < count; n++) diff --git a/benchmark/es/spread-bench.js b/benchmark/es/spread-bench.js index 067299cd650919..97c7596b6b732b 100644 --- a/benchmark/es/spread-bench.js +++ b/benchmark/es/spread-bench.js @@ -8,7 +8,7 @@ const bench = common.createBenchmark(main, { count: [5, 10, 20], context: ['context', 'null'], rest: [0, 1], - millions: [5] + n: [5e6] }); function makeTest(count, rest) { @@ -23,7 +23,7 @@ function makeTest(count, rest) { } } -function main({ millions, context, count, rest, method }) { +function main({ n, context, count, rest, method }) { const ctx = context === 'context' ? {} : null; var fn = makeTest(count, rest); const args = new Array(count); @@ -36,23 +36,23 @@ function main({ millions, context, count, rest, method }) { // Empty string falls through to next line as default, mostly for tests. case 'apply': bench.start(); - for (i = 0; i < millions * 1e6; i++) + for (i = 0; i < n; i++) fn.apply(ctx, args); - bench.end(millions); + bench.end(n); break; case 'spread': if (ctx !== null) fn = fn.bind(ctx); bench.start(); - for (i = 0; i < millions * 1e6; i++) + for (i = 0; i < n; i++) fn(...args); - bench.end(millions); + bench.end(n); break; case 'call-spread': bench.start(); - for (i = 0; i < millions * 1e6; i++) + for (i = 0; i < n; i++) fn.call(ctx, ...args); - bench.end(millions); + bench.end(n); break; default: throw new Error(`Unexpected method "${method}"`); diff --git a/benchmark/misc/function_call/index.js b/benchmark/misc/function_call/index.js index 28561bc48cd7c3..cafff3edc122c6 100644 --- a/benchmark/misc/function_call/index.js +++ b/benchmark/misc/function_call/index.js @@ -1,6 +1,6 @@ // show the difference between calling a short js function // relative to a comparable C++ function. -// Reports millions of calls per second. +// Reports n of calls per second. // Note that JS speed goes up, while cxx speed stays about the same. 'use strict'; @@ -28,14 +28,14 @@ assert(js() === cxx()); const bench = common.createBenchmark(main, { type: ['js', 'cxx'], - millions: [1, 10, 50] + n: [1e6, 1e7, 5e7] }); -function main({ millions, type }) { +function main({ n, type }) { const fn = type === 'cxx' ? cxx : js; bench.start(); - for (var i = 0; i < millions * 1e6; i++) { + for (var i = 0; i < n; i++) { fn(); } - bench.end(millions); + bench.end(n); } diff --git a/benchmark/misc/object-property-bench.js b/benchmark/misc/object-property-bench.js index 3a181ed0a540f8..fae11119b6fe23 100644 --- a/benchmark/misc/object-property-bench.js +++ b/benchmark/misc/object-property-bench.js @@ -6,7 +6,7 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { method: ['property', 'string', 'variable', 'symbol'], - millions: [1000] + n: [1e9] }); function runProperty(n) { @@ -18,7 +18,7 @@ function runProperty(n) { object.p2 = 21; object.p1 += object.p2; } - bench.end(n / 1e6); + bench.end(n); } function runString(n) { @@ -30,7 +30,7 @@ function runString(n) { object['p2'] = 21; object['p1'] += object['p2']; } - bench.end(n / 1e6); + bench.end(n); } function runVariable(n) { @@ -44,7 +44,7 @@ function runVariable(n) { object[var2] = 21; object[var1] += object[var2]; } - bench.end(n / 1e6); + bench.end(n); } function runSymbol(n) { @@ -58,11 +58,10 @@ function runSymbol(n) { object[symbol2] = 21; object[symbol1] += object[symbol2]; } - bench.end(n / 1e6); + bench.end(n); } -function main({ millions, method }) { - const n = millions * 1e6; +function main({ n, method }) { switch (method) { // '' is a default case for tests diff --git a/benchmark/module/module-loader.js b/benchmark/module/module-loader.js index 58d4dcf81c9316..c79e1a73d4f21a 100644 --- a/benchmark/module/module-loader.js +++ b/benchmark/module/module-loader.js @@ -7,16 +7,15 @@ const tmpdir = require('../../test/common/tmpdir'); const benchmarkDirectory = path.join(tmpdir.path, 'nodejs-benchmark-module'); const bench = common.createBenchmark(main, { - thousands: [50], + n: [5e4], fullPath: ['true', 'false'], useCache: ['true', 'false'] }); -function main({ thousands, fullPath, useCache }) { +function main({ n, fullPath, useCache }) { tmpdir.refresh(); try { fs.mkdirSync(benchmarkDirectory); } catch (e) {} - - for (var i = 0; i <= thousands * 1e3; i++) { + for (var i = 0; i <= n; i++) { fs.mkdirSync(`${benchmarkDirectory}${i}`); fs.writeFileSync( `${benchmarkDirectory}${i}/package.json`, @@ -29,37 +28,37 @@ function main({ thousands, fullPath, useCache }) { } if (fullPath === 'true') - measureFull(thousands, useCache === 'true'); + measureFull(n, useCache === 'true'); else - measureDir(thousands, useCache === 'true'); + measureDir(n, useCache === 'true'); tmpdir.refresh(); } -function measureFull(thousands, useCache) { +function measureFull(n, useCache) { var i; if (useCache) { - for (i = 0; i <= thousands * 1e3; i++) { + for (i = 0; i <= n; i++) { require(`${benchmarkDirectory}${i}/index.js`); } } bench.start(); - for (i = 0; i <= thousands * 1e3; i++) { + for (i = 0; i <= n; i++) { require(`${benchmarkDirectory}${i}/index.js`); } - bench.end(thousands); + bench.end(n); } -function measureDir(thousands, useCache) { +function measureDir(n, useCache) { var i; if (useCache) { - for (i = 0; i <= thousands * 1e3; i++) { + for (i = 0; i <= n; i++) { require(`${benchmarkDirectory}${i}`); } } bench.start(); - for (i = 0; i <= thousands * 1e3; i++) { + for (i = 0; i <= n; i++) { require(`${benchmarkDirectory}${i}`); } - bench.end(thousands); + bench.end(n); } diff --git a/benchmark/process/next-tick-breadth-args.js b/benchmark/process/next-tick-breadth-args.js index d759b955c429fe..6baa8d99609030 100644 --- a/benchmark/process/next-tick-breadth-args.js +++ b/benchmark/process/next-tick-breadth-args.js @@ -2,36 +2,35 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - millions: [4] + n: [4e6] }); -function main({ millions }) { - const N = millions * 1e6; - var n = 0; +function main({ n }) { + var j = 0; function cb1(arg1) { - n++; - if (n === N) - bench.end(n / 1e6); + j++; + if (j === n) + bench.end(n); } function cb2(arg1, arg2) { - n++; - if (n === N) - bench.end(n / 1e6); + j++; + if (j === n) + bench.end(n); } function cb3(arg1, arg2, arg3) { - n++; - if (n === N) - bench.end(n / 1e6); + j++; + if (j === n) + bench.end(n); } function cb4(arg1, arg2, arg3, arg4) { - n++; - if (n === N) - bench.end(n / 1e6); + j++; + if (j === n) + bench.end(n); } bench.start(); - for (var i = 0; i < N; i++) { + for (var i = 0; i < n; i++) { if (i % 4 === 0) process.nextTick(cb4, 3.14, 1024, true, false); else if (i % 3 === 0) diff --git a/benchmark/process/next-tick-breadth.js b/benchmark/process/next-tick-breadth.js index aebd623869b577..392d8e02093707 100644 --- a/benchmark/process/next-tick-breadth.js +++ b/benchmark/process/next-tick-breadth.js @@ -2,21 +2,20 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - millions: [4] + n: [4e6] }); -function main({ millions }) { - const N = millions * 1e6; - var n = 0; +function main({ n }) { + var j = 0; function cb() { - n++; - if (n === N) - bench.end(n / 1e6); + j++; + if (j === n) + bench.end(n); } bench.start(); - for (var i = 0; i < N; i++) { + for (var i = 0; i < n; i++) { process.nextTick(cb); } } diff --git a/benchmark/process/next-tick-depth-args.js b/benchmark/process/next-tick-depth-args.js index 1c1b95bdc84bd1..52d349c776b326 100644 --- a/benchmark/process/next-tick-depth-args.js +++ b/benchmark/process/next-tick-depth-args.js @@ -2,14 +2,12 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - millions: [12] + n: [12e6] }); process.maxTickDepth = Infinity; -function main({ millions }) { - var n = millions * 1e6; - +function main({ n }) { function cb4(arg1, arg2, arg3, arg4) { if (--n) { if (n % 4 === 0) @@ -21,7 +19,7 @@ function main({ millions }) { else process.nextTick(cb1, 0); } else - bench.end(millions); + bench.end(n); } function cb3(arg1, arg2, arg3) { if (--n) { @@ -34,7 +32,7 @@ function main({ millions }) { else process.nextTick(cb1, 0); } else - bench.end(millions); + bench.end(n); } function cb2(arg1, arg2) { if (--n) { @@ -47,7 +45,7 @@ function main({ millions }) { else process.nextTick(cb1, 0); } else - bench.end(millions); + bench.end(n); } function cb1(arg1) { if (--n) { @@ -60,7 +58,7 @@ function main({ millions }) { else process.nextTick(cb1, 0); } else - bench.end(millions); + bench.end(n); } bench.start(); process.nextTick(cb1, true); diff --git a/benchmark/process/next-tick-depth.js b/benchmark/process/next-tick-depth.js index 99fc83c3772276..6669936e398272 100644 --- a/benchmark/process/next-tick-depth.js +++ b/benchmark/process/next-tick-depth.js @@ -1,13 +1,12 @@ 'use strict'; const common = require('../common.js'); const bench = common.createBenchmark(main, { - millions: [12] + n: [12e6] }); process.maxTickDepth = Infinity; -function main({ millions }) { - var n = millions * 1e6; +function main({ n }) { bench.start(); process.nextTick(onNextTick); @@ -15,6 +14,6 @@ function main({ millions }) { if (--n) process.nextTick(onNextTick); else - bench.end(millions); + bench.end(n); } } diff --git a/benchmark/process/next-tick-exec-args.js b/benchmark/process/next-tick-exec-args.js index 9e8ff73838460a..3be86cc08e177a 100644 --- a/benchmark/process/next-tick-exec-args.js +++ b/benchmark/process/next-tick-exec-args.js @@ -1,11 +1,10 @@ 'use strict'; const common = require('../common.js'); const bench = common.createBenchmark(main, { - millions: [5] + n: [5e6] }); -function main({ millions }) { - var n = millions * 1e6; +function main({ n }) { bench.start(); for (var i = 0; i < n; i++) { @@ -20,6 +19,6 @@ function main({ millions }) { } function onNextTick(i) { if (i + 1 === n) - bench.end(millions); + bench.end(n); } } diff --git a/benchmark/process/next-tick-exec.js b/benchmark/process/next-tick-exec.js index a8897cd7456476..d00ee017de4bff 100644 --- a/benchmark/process/next-tick-exec.js +++ b/benchmark/process/next-tick-exec.js @@ -1,11 +1,10 @@ 'use strict'; const common = require('../common.js'); const bench = common.createBenchmark(main, { - millions: [5] + n: [5e6] }); -function main({ millions }) { - var n = millions * 1e6; +function main({ n }) { bench.start(); for (var i = 0; i < n; i++) { @@ -13,6 +12,6 @@ function main({ millions }) { } function onNextTick(i) { if (i + 1 === n) - bench.end(millions); + bench.end(n); } } diff --git a/benchmark/streams/readable-bigread.js b/benchmark/streams/readable-bigread.js index 62d1af874fb22a..c3cff3d933d915 100644 --- a/benchmark/streams/readable-bigread.js +++ b/benchmark/streams/readable-bigread.js @@ -4,7 +4,7 @@ const common = require('../common'); const Readable = require('stream').Readable; const bench = common.createBenchmark(main, { - n: [100e1] + n: [1e3] }); function main({ n }) { diff --git a/benchmark/streams/readable-bigunevenread.js b/benchmark/streams/readable-bigunevenread.js index e13769189a69da..95a4139c069e87 100644 --- a/benchmark/streams/readable-bigunevenread.js +++ b/benchmark/streams/readable-bigunevenread.js @@ -4,7 +4,7 @@ const common = require('../common'); const Readable = require('stream').Readable; const bench = common.createBenchmark(main, { - n: [100e1] + n: [1e3] }); function main({ n }) { diff --git a/benchmark/streams/readable-unevenread.js b/benchmark/streams/readable-unevenread.js index f8b501ab4729ec..690f1f420838c6 100644 --- a/benchmark/streams/readable-unevenread.js +++ b/benchmark/streams/readable-unevenread.js @@ -4,7 +4,7 @@ const common = require('../common'); const Readable = require('stream').Readable; const bench = common.createBenchmark(main, { - n: [100e1] + n: [1e3] }); function main({ n }) { diff --git a/benchmark/timers/immediate.js b/benchmark/timers/immediate.js index 7ddb5cb05af40d..6a34becb918f48 100644 --- a/benchmark/timers/immediate.js +++ b/benchmark/timers/immediate.js @@ -2,30 +2,29 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - thousands: [5000], + n: [5e6], type: ['depth', 'depth1', 'breadth', 'breadth1', 'breadth4', 'clear'] }); -function main({ thousands, type }) { - const N = thousands * 1e3; +function main({ n, type }) { switch (type) { case 'depth': - depth(N); + depth(n); break; case 'depth1': - depth1(N); + depth1(n); break; case 'breadth': - breadth(N); + breadth(n); break; case 'breadth1': - breadth1(N); + breadth1(n); break; case 'breadth4': - breadth4(N); + breadth4(n); break; case 'clear': - clear(N); + clear(n); break; } } @@ -38,7 +37,7 @@ function depth(N) { function cb() { n++; if (n === N) - bench.end(N / 1e3); + bench.end(n); else setImmediate(cb); } @@ -52,7 +51,7 @@ function depth1(N) { function cb(a1) { n++; if (n === N) - bench.end(N / 1e3); + bench.end(N); else setImmediate(cb, 1); } @@ -65,7 +64,7 @@ function breadth(N) { function cb() { n++; if (n === N) - bench.end(N / 1e3); + bench.end(N); } for (var i = 0; i < N; i++) { setImmediate(cb); @@ -79,7 +78,7 @@ function breadth1(N) { function cb(a1) { n++; if (n === N) - bench.end(N / 1e3); + bench.end(n); } for (var i = 0; i < N; i++) { setImmediate(cb, 1); @@ -94,7 +93,7 @@ function breadth4(N) { function cb(a1, a2, a3, a4) { n++; if (n === N) - bench.end(N / 1e3); + bench.end(n); } for (var i = 0; i < N; i++) { setImmediate(cb, 1, 2, 3, 4); @@ -106,7 +105,7 @@ function clear(N) { bench.start(); function cb(a1) { if (a1 === 2) - bench.end(N / 1e3); + bench.end(N); } for (var i = 0; i < N; i++) { clearImmediate(setImmediate(cb, 1)); diff --git a/benchmark/timers/set-immediate-breadth-args.js b/benchmark/timers/set-immediate-breadth-args.js index d5b5a9878066db..25147a5ea2a972 100644 --- a/benchmark/timers/set-immediate-breadth-args.js +++ b/benchmark/timers/set-immediate-breadth-args.js @@ -2,14 +2,13 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - millions: [5] + n: [5e6] }); -function main({ millions }) { - const N = millions * 1e6; +function main({ n }) { process.on('exit', function() { - bench.end(N / 1e6); + bench.end(n); }); function cb1(arg1) {} @@ -17,7 +16,7 @@ function main({ millions }) { function cb3(arg1, arg2, arg3) {} bench.start(); - for (let i = 0; i < N; i++) { + for (let i = 0; i < n; i++) { if (i % 3 === 0) setImmediate(cb3, 512, true, null, 512, true, null); else if (i % 2 === 0) diff --git a/benchmark/timers/set-immediate-breadth.js b/benchmark/timers/set-immediate-breadth.js index 4f7d2cd2761334..44afe5aad9fbd3 100644 --- a/benchmark/timers/set-immediate-breadth.js +++ b/benchmark/timers/set-immediate-breadth.js @@ -2,20 +2,19 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - millions: [10] + n: [1e7] }); -function main({ millions }) { - const N = millions * 1e6; +function main({ n }) { process.on('exit', function() { - bench.end(millions); + bench.end(n); }); function cb() {} bench.start(); - for (let i = 0; i < N; i++) { + for (let i = 0; i < n; i++) { setImmediate(cb); } } diff --git a/benchmark/timers/set-immediate-depth-args.js b/benchmark/timers/set-immediate-depth-args.js index aa5ec95f7dad30..2b18fcfd6341f2 100644 --- a/benchmark/timers/set-immediate-depth-args.js +++ b/benchmark/timers/set-immediate-depth-args.js @@ -2,14 +2,13 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - millions: [5] + n: [5e6] }); -function main({ millions }) { - const N = millions * 1e6; +function main({ n }) { process.on('exit', function() { - bench.end(millions); + bench.end(n); }); function cb3(n, arg2, arg3) { @@ -43,5 +42,5 @@ function main({ millions }) { } } bench.start(); - setImmediate(cb1, N); + setImmediate(cb1, n); } diff --git a/benchmark/timers/timers-breadth.js b/benchmark/timers/timers-breadth.js index b05b3f91b1859d..8cd77f4fab2852 100644 --- a/benchmark/timers/timers-breadth.js +++ b/benchmark/timers/timers-breadth.js @@ -2,19 +2,18 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - thousands: [5000], + n: [5e6], }); -function main({ thousands }) { - const N = thousands * 1e3; - var n = 0; +function main({ n }) { + var j = 0; bench.start(); function cb() { - n++; - if (n === N) - bench.end(N / 1e3); + j++; + if (j === n) + bench.end(n); } - for (var i = 0; i < N; i++) { + for (var i = 0; i < n; i++) { setTimeout(cb, 1); } } diff --git a/benchmark/timers/timers-cancel-pooled.js b/benchmark/timers/timers-cancel-pooled.js index 3e262f820a3e08..6f16f3c91da8a8 100644 --- a/benchmark/timers/timers-cancel-pooled.js +++ b/benchmark/timers/timers-cancel-pooled.js @@ -3,14 +3,13 @@ const common = require('../common.js'); const assert = require('assert'); const bench = common.createBenchmark(main, { - millions: [5], + n: [5e6], }); -function main({ millions }) { - const iterations = millions * 1e6; +function main({ n }) { var timer = setTimeout(() => {}, 1); - for (var i = 0; i < iterations; i++) { + for (var i = 0; i < n; i++) { setTimeout(cb, 1); } var next = timer._idlePrev; @@ -18,13 +17,13 @@ function main({ millions }) { bench.start(); - for (var j = 0; j < iterations; j++) { + for (var j = 0; j < n; j++) { timer = next; next = timer._idlePrev; clearTimeout(timer); } - bench.end(iterations / 1e6); + bench.end(n); } function cb() { diff --git a/benchmark/timers/timers-cancel-unpooled.js b/benchmark/timers/timers-cancel-unpooled.js index 158667311330a4..7b46bad719a9c3 100644 --- a/benchmark/timers/timers-cancel-unpooled.js +++ b/benchmark/timers/timers-cancel-unpooled.js @@ -3,22 +3,21 @@ const common = require('../common.js'); const assert = require('assert'); const bench = common.createBenchmark(main, { - millions: [1], + n: [1e6], }); -function main({ millions }) { - const iterations = millions * 1e6; +function main({ n }) { const timersList = []; - for (var i = 0; i < iterations; i++) { + for (var i = 0; i < n; i++) { timersList.push(setTimeout(cb, i + 1)); } bench.start(); - for (var j = 0; j < iterations + 1; j++) { + for (var j = 0; j < n + 1; j++) { clearTimeout(timersList[j]); } - bench.end(iterations / 1e6); + bench.end(n); } function cb() { diff --git a/benchmark/timers/timers-depth.js b/benchmark/timers/timers-depth.js index ca74eee393fd45..bfc6dd02cf5c65 100644 --- a/benchmark/timers/timers-depth.js +++ b/benchmark/timers/timers-depth.js @@ -2,18 +2,17 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - thousands: [1], + n: [1e3], }); -function main({ thousands }) { - const N = thousands * 1e3; - var n = 0; +function main({ n }) { + var i = 0; bench.start(); setTimeout(cb, 1); function cb() { - n++; - if (n === N) - bench.end(N / 1e3); + i++; + if (i === n) + bench.end(n); else setTimeout(cb, 1); } diff --git a/benchmark/timers/timers-insert-pooled.js b/benchmark/timers/timers-insert-pooled.js index 59d2c490c3a9b2..a7441a9eaf76f6 100644 --- a/benchmark/timers/timers-insert-pooled.js +++ b/benchmark/timers/timers-insert-pooled.js @@ -2,17 +2,16 @@ const common = require('../common.js'); const bench = common.createBenchmark(main, { - millions: [5], + n: [5e6], }); -function main({ millions }) { - const iterations = millions * 1e6; +function main({ n }) { bench.start(); - for (var i = 0; i < iterations; i++) { + for (var i = 0; i < n; i++) { setTimeout(() => {}, 1); } - bench.end(iterations / 1e6); + bench.end(n); } diff --git a/benchmark/timers/timers-insert-unpooled.js b/benchmark/timers/timers-insert-unpooled.js index fbbeebb759ff3a..1f1c5155a77748 100644 --- a/benchmark/timers/timers-insert-unpooled.js +++ b/benchmark/timers/timers-insert-unpooled.js @@ -3,21 +3,19 @@ const common = require('../common.js'); const assert = require('assert'); const bench = common.createBenchmark(main, { - millions: [1], + n: [1e6], }); -function main({ millions }) { - const iterations = millions * 1e6; - +function main({ n }) { const timersList = []; bench.start(); - for (var i = 0; i < iterations; i++) { + for (var i = 0; i < n; i++) { timersList.push(setTimeout(cb, i + 1)); } - bench.end(iterations / 1e6); + bench.end(n); - for (var j = 0; j < iterations + 1; j++) { + for (var j = 0; j < n + 1; j++) { clearTimeout(timersList[j]); } } diff --git a/benchmark/timers/timers-timeout-pooled.js b/benchmark/timers/timers-timeout-pooled.js index df88e2784f8f91..d34080fa668422 100644 --- a/benchmark/timers/timers-timeout-pooled.js +++ b/benchmark/timers/timers-timeout-pooled.js @@ -5,11 +5,10 @@ const common = require('../common.js'); // which then get executed on the next uv tick const bench = common.createBenchmark(main, { - millions: [10], + n: [1e7], }); -function main({ millions }) { - const iterations = millions * 1e6; +function main({ n }) { let count = 0; // Function tracking on the hidden class in V8 can cause misleading @@ -18,16 +17,16 @@ function main({ millions }) { function cb() { count++; - if (count === iterations) - bench.end(iterations / 1e6); + if (count === n) + bench.end(n); } function cb2() { count++; - if (count === iterations) - bench.end(iterations / 1e6); + if (count === n) + bench.end(n); } - for (var i = 0; i < iterations; i++) { + for (var i = 0; i < n; i++) { setTimeout(i % 2 ? cb : cb2, 1); } diff --git a/lib/internal/modules/cjs/helpers.js b/lib/internal/modules/cjs/helpers.js index 61565cc5932564..7d603f640c19b3 100644 --- a/lib/internal/modules/cjs/helpers.js +++ b/lib/internal/modules/cjs/helpers.js @@ -9,6 +9,13 @@ const { CHAR_HASH, } = require('internal/constants'); +const { + CHAR_LINE_FEED, + CHAR_CARRIAGE_RETURN, + CHAR_EXCLAMATION_MARK, + CHAR_HASH, +} = require('internal/constants'); + // Invoke with makeRequireFunction(module) where |module| is the Module object // to use as the context for the require() function. function makeRequireFunction(mod) { diff --git a/test/parallel/test-benchmark-es.js b/test/parallel/test-benchmark-es.js index 8176ad0b07e9ac..47fe4ab3f91a63 100644 --- a/test/parallel/test-benchmark-es.js +++ b/test/parallel/test-benchmark-es.js @@ -7,7 +7,6 @@ const runBenchmark = require('../common/benchmark'); runBenchmark('es', [ 'method=', - 'millions=0.000001', 'count=1', 'context=null', 'rest=0', diff --git a/test/parallel/test-benchmark-misc.js b/test/parallel/test-benchmark-misc.js index 52f568f97428fb..b7e21602d5fed9 100644 --- a/test/parallel/test-benchmark-misc.js +++ b/test/parallel/test-benchmark-misc.js @@ -7,7 +7,6 @@ const runBenchmark = require('../common/benchmark'); runBenchmark('misc', [ 'concat=0', 'method=', - 'millions=.000001', 'n=1', 'type=extend', 'val=magyarország.icom.museum' diff --git a/test/parallel/test-benchmark-module.js b/test/parallel/test-benchmark-module.js index f68fd314f20e1b..d81936210c00fe 100644 --- a/test/parallel/test-benchmark-module.js +++ b/test/parallel/test-benchmark-module.js @@ -5,7 +5,7 @@ require('../common'); const runBenchmark = require('../common/benchmark'); runBenchmark('module', [ - 'thousands=.001', + 'n=1', 'useCache=true', 'fullPath=true' ]); diff --git a/test/parallel/test-benchmark-process.js b/test/parallel/test-benchmark-process.js index c11d82b327f743..15cb678017e7bb 100644 --- a/test/parallel/test-benchmark-process.js +++ b/test/parallel/test-benchmark-process.js @@ -6,7 +6,6 @@ const runBenchmark = require('../common/benchmark'); runBenchmark('process', [ - 'millions=0.000001', 'n=1', 'type=raw' ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/parallel/test-benchmark-timers.js b/test/parallel/test-benchmark-timers.js index 4cbcb1f11b9327..433a12e8258c64 100644 --- a/test/parallel/test-benchmark-timers.js +++ b/test/parallel/test-benchmark-timers.js @@ -7,8 +7,6 @@ const runBenchmark = require('../common/benchmark'); runBenchmark('timers', [ 'type=depth', - 'n=1', - 'millions=0.000001', - 'thousands=0.001' + 'n=1' ], { NODEJS_BENCHMARK_ZERO_ALLOWED: 1 }); diff --git a/test/parallel/test-http2-client-write-empty-string.js b/test/parallel/test-http2-client-write-empty-string.js index 8b8cb3d6404e1e..dc0f0eea2c55e5 100644 --- a/test/parallel/test-http2-client-write-empty-string.js +++ b/test/parallel/test-http2-client-write-empty-string.js @@ -1,12 +1,11 @@ 'use strict'; const assert = require('assert'); - +const http2 = require('http2'); const common = require('../common'); if (!common.hasCrypto) common.skip('missing crypto'); -const http2 = require('http2'); for (const chunkSequence of [ [ '' ], diff --git a/test/sequential/test-benchmark-buffer.js b/test/sequential/test-benchmark-buffer.js index 4eb4415a61dd7f..5ac9ffb84a7316 100644 --- a/test/sequential/test-benchmark-buffer.js +++ b/test/sequential/test-benchmark-buffer.js @@ -13,7 +13,6 @@ runBenchmark('buffers', 'encoding=utf8', 'endian=BE', 'len=2', - 'millions=0.000001', 'method=', 'n=1', 'pieces=1',