mirror of
https://github.com/zebrajr/node.git
synced 2025-12-06 12:20:27 +01:00
This significantly reduces the benchmark runtime. It removes to many variations that do not provide any benefit and reduces the iterations. PR-URL: https://github.com/nodejs/node/pull/22503 Reviewed-By: Matteo Collina <matteo.collina@gmail.com> Reviewed-By: John-David Dalton <john.david.dalton@gmail.com> Reviewed-By: Benjamin Gruenbaum <benjamingr@gmail.com> Reviewed-By: Refael Ackermann <refack@gmail.com>
16 lines
394 B
JavaScript
16 lines
394 B
JavaScript
'use strict';
|
|
|
|
const util = require('util');
|
|
const common = require('../common.js');
|
|
|
|
const bench = common.createBenchmark(main, { n: [2e4] });
|
|
|
|
function main({ n }) {
|
|
const proxyA = new Proxy({}, { get: () => {} });
|
|
const proxyB = new Proxy(() => {}, {});
|
|
bench.start();
|
|
for (var i = 0; i < n; i += 1)
|
|
util.inspect({ a: proxyA, b: proxyB }, { showProxy: true });
|
|
bench.end(n);
|
|
}
|