Skip to content

Commit 159b9cf

Browse files
BridgeARRafaelGSS
authored andcommitted
benchmark: adjust assert runtimes
Each file should have a reasonable runtime while having a good accuracy. This adjust those up and down to have minimal runtimes with a good accuracy. PR-URL: #57370 Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com> Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
1 parent 073b15d commit 159b9cf

6 files changed

+13
-8
lines changed

benchmark/assert/assertion-error.js

+2-3
Original file line numberDiff line numberDiff line change
@@ -3,9 +3,8 @@ const common = require('../common.js');
33
const assert = require('assert');
44

55
const bench = common.createBenchmark(main, {
6-
n: [10, 50, 200, 500],
7-
size: [10, 100],
8-
datasetName: ['objects'],
6+
n: [200],
7+
size: [2, 75],
98
});
109

1110
const baseObject = {

benchmark/assert/deepequal-map.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { deepEqual, deepStrictEqual, notDeepEqual, notDeepStrictEqual } =
55
require('assert');
66

77
const bench = common.createBenchmark(main, {
8-
n: [5e3],
8+
n: [2e3],
99
len: [5e2],
1010
strict: [0, 1],
1111
method: [

benchmark/assert/deepequal-object.js

+2-2
Original file line numberDiff line numberDiff line change
@@ -4,12 +4,12 @@ const common = require('../common.js');
44
const assert = require('assert');
55

66
const bench = common.createBenchmark(main, {
7-
n: [25, 2e2],
7+
n: [50, 2e2],
88
size: [1e2, 1e4],
99
method: ['deepEqual', 'notDeepEqual', 'deepStrictEqual', 'notDeepStrictEqual'],
1010
}, {
1111
combinationFilter: (p) => {
12-
return p.size === 1e4 && p.n === 25 ||
12+
return p.size === 1e4 && p.n === 50 ||
1313
p.size === 1e3 && p.n === 2e2 ||
1414
p.size === 1e2 && p.n === 2e3 ||
1515
p.size === 1;

benchmark/assert/deepequal-set.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { deepEqual, deepStrictEqual, notDeepEqual, notDeepStrictEqual } =
55
require('assert');
66

77
const bench = common.createBenchmark(main, {
8-
n: [5e2],
8+
n: [1e3],
99
len: [5e2],
1010
strict: [0, 1],
1111
method: [

benchmark/assert/deepequal-simple-array-and-set.js

+1-1
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ const { deepEqual, deepStrictEqual, notDeepEqual, notDeepStrictEqual } =
55
require('assert');
66

77
const bench = common.createBenchmark(main, {
8-
n: [5e2],
8+
n: [1e3],
99
len: [1e4],
1010
strict: [1],
1111
method: [

benchmark/assert/deepequal-typedarrays.js

+6
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,12 @@ const bench = common.createBenchmark(main, {
1616
'notDeepEqual',
1717
],
1818
len: [1e2, 5e3],
19+
}, {
20+
combinationFilter(p) {
21+
return p.strict === 1 ||
22+
p.type !== 'Float32Array' ||
23+
p.len === 1e2;
24+
},
1925
});
2026

2127
function main({ type, n, len, method, strict }) {

0 commit comments

Comments
 (0)