1'use strict'; 2 3const util = require('util'); 4const common = require('../common.js'); 5 6const bench = common.createBenchmark(main, { 7 n: [1e5], 8 showProxy: [0, 1], 9 isProxy: [0, 1] 10}); 11 12function main({ n, showProxy, isProxy }) { 13 let proxyA = {}; 14 let proxyB = () => {}; 15 if (isProxy) { 16 proxyA = new Proxy(proxyA, { get: () => {} }); 17 proxyB = new Proxy(proxyB, {}); 18 } 19 bench.start(); 20 for (let i = 0; i < n; i += 1) 21 util.inspect({ a: proxyA, b: proxyB }, { showProxy }); 22 bench.end(n); 23} 24