mirror of
https://github.com/nodejs/node.git
synced 2024-11-21 10:59:27 +00:00
db8217b1bf
PR-URL: https://github.com/nodejs/node/pull/49643 Reviewed-By: Yagiz Nizipli <yagiz@nizipli.com> Reviewed-By: LiviaMedeiros <livia@cirno.name> Reviewed-By: Antoine du Hamel <duhamelantoine1995@gmail.com>
24 lines
468 B
JavaScript
24 lines
468 B
JavaScript
'use strict';
|
|
|
|
const common = require('../common.js');
|
|
|
|
const bench = common.createBenchmark(main, {
|
|
n: [1e5],
|
|
}, {
|
|
flags: ['--expose-internals'],
|
|
});
|
|
|
|
const instances = Array.from({ length: 1000 }).map(() => 'Uint8Array');
|
|
|
|
function main({ n }) {
|
|
const {
|
|
codes: {
|
|
ERR_INVALID_ARG_TYPE,
|
|
},
|
|
} = require('internal/errors');
|
|
bench.start();
|
|
for (let i = 0; i < n; ++i)
|
|
new ERR_INVALID_ARG_TYPE('target', instances, 'test');
|
|
bench.end(n);
|
|
}
|