GeezerVison is showing github.com — Revert "benchmark: remove special test entries" · GLStephen/node@7cfbc9f
File treeExpand file treeCollapse file tree Open diff view settings Some content is hiddenLarge Commits have some content hidden by default. Use the searchbox below for content that may be hidden. Dismiss bannerExpand file treeCollapse file tree Open diff view settings Collapse file Copy file name to clipboardExpand all lines: benchmark/assert/deepequal-buffer.js +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -6,10 +6,12 @@ const bench = common.createBenchmark(main, { | 6 | 6 | n: [2e4], | 7 | 7 | len: [1e2, 1e3], | 8 | 8 | strict: [0, 1], | 9 | | - method: ['deepEqual', 'notDeepEqual'], | | 9 | + method: [ 'deepEqual', 'notDeepEqual' ], | 10 | 10 | }); | 11 | 11 |
| 12 | 12 | function main({ len, n, method, strict }) { | | 13 | + if (!method) | | 14 | + method = 'deepEqual'; | 13 | 15 | const data = Buffer.allocUnsafe(len + 1); | 14 | 16 | const actual = Buffer.alloc(len); | 15 | 17 | const expected = Buffer.alloc(len); | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/assert/deepequal-map.js +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,6 +34,8 @@ function main({ n, len, method, strict }) { | 34 | 34 | const array = Array(len).fill(1); | 35 | 35 |
| 36 | 36 | switch (method) { | | 37 | + case '': | | 38 | + // Empty string falls through to next line as default, mostly for tests. | 37 | 39 | case 'deepEqual_primitiveOnly': { | 38 | 40 | const values = array.map((_, i) => [`str_${i}`, 123]); | 39 | 41 | benchmark(strict ? deepStrictEqual : deepEqual, n, values); | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/assert/deepequal-object.js +4-1Lines changed: 4 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -7,7 +7,7 @@ const bench = common.createBenchmark(main, { | 7 | 7 | n: [5e3], | 8 | 8 | size: [1e2, 1e3, 5e4], | 9 | 9 | strict: [0, 1], | 10 | | - method: ['deepEqual', 'notDeepEqual'], | | 10 | + method: [ 'deepEqual', 'notDeepEqual' ], | 11 | 11 | }); | 12 | 12 |
| 13 | 13 | function createObj(source, add = '') { | @@ -27,6 +27,9 @@ function main({ size, n, method, strict }) { | 27 | 27 | // TODO: Fix this "hack". `n` should not be manipulated. | 28 | 28 | n = Math.min(Math.ceil(n / size), 20); | 29 | 29 |
| | 30 | + if (!method) | | 31 | + method = 'deepEqual'; | | 32 | + | 30 | 33 | const source = Array.apply(null, Array(size)); | 31 | 34 | const actual = createObj(source); | 32 | 35 | const expected = createObj(source); | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/assert/deepequal-prims-and-objs-big-array-set.js +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -52,6 +52,8 @@ function main({ n, len, primitive, method, strict }) { | 52 | 52 | const expectedWrongSet = new Set(expectedWrong); | 53 | 53 |
| 54 | 54 | switch (method) { | | 55 | + // Empty string falls through to next line as default, mostly for tests. | | 56 | + case '': | 55 | 57 | case 'deepEqual_Array': | 56 | 58 | run(strict ? deepStrictEqual : deepEqual, n, actual, expected); | 57 | 59 | break; | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/assert/deepequal-prims-and-objs-big-loop.js +3-1Lines changed: 3 additions & 1 deletion | Original file line number | Diff line number | Diff line change |
|---|
@@ -13,10 +13,12 @@ const bench = common.createBenchmark(main, { | 13 | 13 | primitive: Object.keys(primValues), | 14 | 14 | n: [2e4], | 15 | 15 | strict: [0, 1], | 16 | | - method: ['deepEqual', 'notDeepEqual'], | | 16 | + method: [ 'deepEqual', 'notDeepEqual' ], | 17 | 17 | }); | 18 | 18 |
| 19 | 19 | function main({ n, primitive, method, strict }) { | | 20 | + if (!method) | | 21 | + method = 'deepEqual'; | 20 | 22 | const prim = primValues[primitive]; | 21 | 23 | const actual = prim; | 22 | 24 | const expected = prim; | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/assert/deepequal-set.js +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -34,6 +34,8 @@ function main({ n, len, method, strict }) { | 34 | 34 | const array = Array(len).fill(1); | 35 | 35 |
| 36 | 36 | switch (method) { | | 37 | + case '': | | 38 | + // Empty string falls through to next line as default, mostly for tests. | 37 | 39 | case 'deepEqual_primitiveOnly': { | 38 | 40 | const values = array.map((_, i) => `str_${i}`); | 39 | 41 | benchmark(strict ? deepStrictEqual : deepEqual, n, values); | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/assert/deepequal-typedarrays.js +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -20,6 +20,8 @@ const bench = common.createBenchmark(main, { | 20 | 20 | }); | 21 | 21 |
| 22 | 22 | function main({ type, n, len, method, strict }) { | | 23 | + if (!method) | | 24 | + method = 'deepEqual'; | 23 | 25 | const clazz = global[type]; | 24 | 26 | const actual = new clazz(len); | 25 | 27 | const expected = new clazz(len); | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/assert/throws.js +2Lines changed: 2 additions & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -15,6 +15,8 @@ function main({ n, method }) { | 15 | 15 | const message = 'failure'; | 16 | 16 |
| 17 | 17 | switch (method) { | | 18 | + case '': | | 19 | + // Empty string falls through to next line as default, mostly for tests. | 18 | 20 | case 'doesNotThrow': | 19 | 21 | bench.start(); | 20 | 22 | for (let i = 0; i < n; ++i) { | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-bytelength.js +2-2Lines changed: 2 additions & 2 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -17,9 +17,9 @@ const chars = [ | 17 | 17 |
| 18 | 18 | function main({ n, len, encoding }) { | 19 | 19 | let strings = []; | 20 | | - let results = [len * 16]; | | 20 | + let results = [ len * 16 ]; | 21 | 21 | if (encoding === 'buffer') { | 22 | | - strings = [Buffer.alloc(len * 16, 'a')]; | | 22 | + strings = [ Buffer.alloc(len * 16, 'a') ]; | 23 | 23 | } else { | 24 | 24 | for (const string of chars) { | 25 | 25 | // Strings must be built differently, depending on encoding | |
Collapse file Copy file name to clipboardExpand all lines: benchmark/buffers/buffer-creation.js +1Lines changed: 1 addition & 0 deletions | Original file line number | Diff line number | Diff line change |
|---|
@@ -16,6 +16,7 @@ const bench = common.createBenchmark(main, { | 16 | 16 | function main({ len, n, type }) { | 17 | 17 | let fn, i; | 18 | 18 | switch (type) { | | 19 | + case '': | 19 | 20 | case 'fast-alloc': | 20 | 21 | fn = Buffer.alloc; | 21 | 22 | break; | |
|