node/benchmark/v8/serialize.js
Rafael Gonzaga 8eeb8fcc00
benchmark: calibrate config v8/serialize.js
According to recent tests with `calibrate-n` on
a dedicated Hetzner machine (4vCPUs | 16gb) the
results got stable with n=1e5.

The work on https://github.com/nodejs/performance/issues/186#issue-3326002531
has shown this benchmark file spends 2-minutes for a single
run. This should improve things a bit.

PR-URL: https://github.com/nodejs/node/pull/59586
Reviewed-By: Luigi Pinca <luigipinca@gmail.com>
Reviewed-By: James M Snell <jasnell@gmail.com>
2025-08-25 13:35:26 +00:00

18 lines
351 B
JavaScript

'use strict';
const common = require('../common.js');
const v8 = require('v8');
const bench = common.createBenchmark(main, {
len: [256, 1024 * 16],
n: [1e5],
});
function main({ n, len }) {
const typedArray = new BigUint64Array(len);
bench.start();
for (let i = 0; i < n; i++)
v8.serialize({ a: 1, b: typedArray });
bench.end(n);
}