Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit d52a71f

Browse filesBrowse files
BridgeARaduh95
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 7592cf4 commit d52a71f
Copy full SHA for d52a71f

File tree

Expand file treeCollapse file tree

6 files changed

+13
-8
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

6 files changed

+13
-8
lines changed
Open diff view settings
Collapse file

‎benchmark/assert/assertion-error.js‎

Copy file name to clipboardExpand all lines: benchmark/assert/assertion-error.js
+2-3Lines changed: 2 additions & 3 deletions
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 = {
Collapse file

‎benchmark/assert/deepequal-map.js‎

Copy file name to clipboardExpand all lines: benchmark/assert/deepequal-map.js
+1-1Lines changed: 1 addition & 1 deletion
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: [
Collapse file

‎benchmark/assert/deepequal-object.js‎

Copy file name to clipboardExpand all lines: benchmark/assert/deepequal-object.js
+2-2Lines changed: 2 additions & 2 deletions
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;
Collapse file

‎benchmark/assert/deepequal-set.js‎

Copy file name to clipboardExpand all lines: benchmark/assert/deepequal-set.js
+1-1Lines changed: 1 addition & 1 deletion
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: [
Collapse file

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

Copy file name to clipboardExpand all lines: benchmark/assert/deepequal-simple-array-and-set.js
+1-1Lines changed: 1 addition & 1 deletion
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: [
Collapse file

‎benchmark/assert/deepequal-typedarrays.js‎

Copy file name to clipboardExpand all lines: benchmark/assert/deepequal-typedarrays.js
+6Lines changed: 6 additions & 0 deletions
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 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.