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: https://github.com/nodejs/node/pull/57370
Reviewed-By: Rafael Gonzaga <rafael.nunu@hotmail.com>
Reviewed-By: Vinícius Lourenço Claro Cardoso <contact@viniciusl.com.br>
This commit is contained in:
Ruben Bridgewater 2025-03-08 18:01:04 +01:00 committed by Node.js GitHub Bot
parent 096b61131a
commit 77607d5306
6 changed files with 13 additions and 8 deletions

View file

@ -3,9 +3,8 @@ const common = require('../common.js');
const assert = require('assert');
const bench = common.createBenchmark(main, {
n: [10, 50, 200, 500],
size: [10, 100],
datasetName: ['objects'],
n: [200],
size: [2, 75],
});
const baseObject = {

View file

@ -5,7 +5,7 @@ const { deepEqual, deepStrictEqual, notDeepEqual, notDeepStrictEqual } =
require('assert');
const bench = common.createBenchmark(main, {
n: [5e3],
n: [2e3],
len: [5e2],
strict: [0, 1],
method: [

View file

@ -4,12 +4,12 @@ const common = require('../common.js');
const assert = require('assert');
const bench = common.createBenchmark(main, {
n: [25, 2e2],
n: [50, 2e2],
size: [1e2, 1e4],
method: ['deepEqual', 'notDeepEqual', 'deepStrictEqual', 'notDeepStrictEqual'],
}, {
combinationFilter: (p) => {
return p.size === 1e4 && p.n === 25 ||
return p.size === 1e4 && p.n === 50 ||
p.size === 1e3 && p.n === 2e2 ||
p.size === 1e2 && p.n === 2e3 ||
p.size === 1;

View file

@ -5,7 +5,7 @@ const { deepEqual, deepStrictEqual, notDeepEqual, notDeepStrictEqual } =
require('assert');
const bench = common.createBenchmark(main, {
n: [5e2],
n: [1e3],
len: [5e2],
strict: [0, 1],
method: [

View file

@ -5,7 +5,7 @@ const { deepEqual, deepStrictEqual, notDeepEqual, notDeepStrictEqual } =
require('assert');
const bench = common.createBenchmark(main, {
n: [5e2],
n: [1e3],
len: [1e4],
strict: [1],
method: [

View file

@ -16,6 +16,12 @@ const bench = common.createBenchmark(main, {
'notDeepEqual',
],
len: [1e2, 5e3],
}, {
combinationFilter(p) {
return p.strict === 1 ||
p.type !== 'Float32Array' ||
p.len === 1e2;
},
});
function main({ type, n, len, method, strict }) {