mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
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>
18 lines
351 B
JavaScript
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);
|
|
}
|