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 7592cf4

Browse filesBrowse files
BridgeARaduh95
authored andcommitted
benchmark: skip running some assert benchmarks by default
These benchmarks are not frequently needed and just slow down the default benchmark suite. They are kept for users who want to run them but deactivated by default. 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 e4cc54a commit 7592cf4
Copy full SHA for 7592cf4

File tree

Expand file treeCollapse file tree

5 files changed

+30
-4
lines changed
Open diff view settings
Filter options
Expand file treeCollapse file tree

5 files changed

+30
-4
lines changed
Open diff view settings
Collapse file

‎benchmark/assert/match.js‎

Copy file name to clipboardExpand all lines: benchmark/assert/match.js
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@ const common = require('../common.js');
44
const assert = require('assert');
55

66
const bench = common.createBenchmark(main, {
7-
n: [25, 2e7],
7+
n: [2e7],
88
method: ['match', 'doesNotMatch'],
9+
}, {
10+
combinationFilter(p) {
11+
// These benchmarks purposefully do not run by default. They do not provide
12+
// might insight, due to only being a small wrapper around a native regexp
13+
// call.
14+
return p.n === 1;
15+
},
916
});
1017

1118
function main({ n, method }) {
Collapse file

‎benchmark/assert/rejects.js‎

Copy file name to clipboardExpand all lines: benchmark/assert/rejects.js
+8-1Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,15 @@ const common = require('../common.js');
44
const assert = require('assert');
55

66
const bench = common.createBenchmark(main, {
7-
n: [25, 2e5],
7+
n: [2e5],
88
method: ['rejects', 'doesNotReject'],
9+
}, {
10+
combinationFilter(p) {
11+
// These benchmarks purposefully do not run by default. They do not provide
12+
// much insight, due to only being a small wrapper around a native promise
13+
// with a few extra checks.
14+
return p.n === 1;
15+
},
916
});
1017

1118
async function main({ n, method }) {
Collapse file

‎benchmark/assert/strictequal.js‎

Copy file name to clipboardExpand all lines: benchmark/assert/strictequal.js
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,9 +4,15 @@ const common = require('../common.js');
44
const assert = require('assert');
55

66
const bench = common.createBenchmark(main, {
7-
n: [25, 2e5],
7+
n: [2e5],
88
type: ['string', 'object', 'number'],
99
method: ['strictEqual', 'notStrictEqual'],
10+
}, {
11+
combinationFilter(p) {
12+
// These benchmarks purposefully do not run by default. They do not provide
13+
// much insight, due to only being a small wrapper around `Object.is()`.
14+
return p.n === 1;
15+
},
1016
});
1117

1218
function main({ type, n, method }) {
Collapse file

‎benchmark/assert/throws.js‎

Copy file name to clipboardExpand all lines: benchmark/assert/throws.js
+7-1Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,8 +4,14 @@ const common = require('../common.js');
44
const assert = require('assert');
55

66
const bench = common.createBenchmark(main, {
7-
n: [25, 2e5],
7+
n: [2e5],
88
method: ['throws', 'doesNotThrow'],
9+
}, {
10+
combinationFilter(p) {
11+
// These benchmarks purposefully do not run by default. They do not provide
12+
// much insight, due to only being a small wrapper around a try / catch.
13+
return p.n === 1;
14+
},
915
});
1016

1117
function main({ n, method }) {
Collapse file
File renamed without changes.

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.