2016-04-29 16:06:48 +08:00
|
|
|
'use strict';
|
|
|
|
|
|
|
|
const util = require('util');
|
|
|
|
const common = require('../common.js');
|
|
|
|
|
2017-08-17 08:37:44 +08:00
|
|
|
const bench = common.createBenchmark(main, { n: [1e6] });
|
2016-04-29 16:06:48 +08:00
|
|
|
|
2017-08-17 08:37:44 +08:00
|
|
|
function main({ n }) {
|
2017-07-11 08:55:21 +08:00
|
|
|
const proxyA = new Proxy({}, { get: () => {} });
|
2017-08-17 08:37:44 +08:00
|
|
|
const proxyB = new Proxy(() => {}, {});
|
2016-04-29 16:06:48 +08:00
|
|
|
bench.start();
|
|
|
|
for (var i = 0; i < n; i += 1)
|
2017-07-11 08:55:21 +08:00
|
|
|
util.inspect({ a: proxyA, b: proxyB }, { showProxy: true });
|
2016-04-29 16:06:48 +08:00
|
|
|
bench.end(n);
|
|
|
|
}
|